UNPKG

react-native-web-internals

Version:

React Native for Web

13 lines (12 loc) 496 B
function isSelectionValid() { const selection = window.getSelection(); if (!selection) return !1; const string = selection.toString(), anchorNode = selection.anchorNode, focusNode = selection.focusNode, isTextNode = anchorNode && anchorNode.nodeType === window.Node.TEXT_NODE || focusNode && focusNode.nodeType === window.Node.TEXT_NODE; return string.length >= 1 && string !== ` ` && !!isTextNode; } export { isSelectionValid as default }; //# sourceMappingURL=index.mjs.map