Files
Checkmate/node_modules/toggle-selection
2024-05-11 09:51:18 +03:30
..
2024-05-11 09:51:18 +03:30
2024-05-11 09:51:18 +03:30
2024-05-11 09:51:18 +03:30
2024-05-11 09:51:18 +03:30
2024-05-11 09:51:18 +03:30

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