Pattern: Accessing selection with global
Issue: -
Avoid accessing the selection with a global. Use the ownerDocument.defaultView
property on a node ref instead.
Example of incorrect code:
window.getSelection();
Example of correct code:
defaultView.getSelection();