litellm/node_modules/toggle-selection
2024-03-29 10:08:35 -07:00
..
example (fix) create key flow 2024-03-29 10:08:35 -07:00
.npmignore (fix) create key flow 2024-03-29 10:08:35 -07:00
index.js (fix) create key flow 2024-03-29 10:08:35 -07:00
package.json (fix) create key flow 2024-03-29 10:08:35 -07:00
README.md (fix) create key flow 2024-03-29 10:08:35 -07:00

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