unis_crm/frontend1/node_modules/toggle-selection
kangwenjing 8606a02971 0326 2026-03-26 17:29:55 +08:00
..
example 0326 2026-03-26 17:29:55 +08:00
.npmignore 0326 2026-03-26 17:29:55 +08:00
README.md 0326 2026-03-26 17:29:55 +08:00
index.js 0326 2026-03-26 17:29:55 +08:00
package.json 0326 2026-03-26 17:29:55 +08:00

README.md

Toggle Selection

Simple module exposing function that deselects current browser selection and returns function that restores selection.

var deselect = require('toggle-selection');
var reselect = deselect(); // remove all selection
// … 
// do something with current selection, text, etc;
// …
reselect(); // restore selection

All credits go to @shvaikalesh.

Example

example recording