rangy
rangy copied to clipboard
A cross-browser JavaScript range and selection library.
I installed the `rangy` by Still could not find the module by `import rangy from 'rangy';` Given the files seems installed. .//node_modules/rangy .//node_modules/rangy/lib/rangy-classapplier.js .//node_modules/rangy/lib/rangy-core.js .//node_modules/rangy/lib/rangy-highlighter.js .//node_modules/rangy/lib/rangy-selectionsaverestore.js .//node_modules/rangy/lib/rangy-serializer.js .//node_modules/rangy/lib/rangy-textrange.js
The [findText()](https://github.com/timdown/rangy/wiki/Text-Range-Module#findtextmixed-searchterm-object-options) method of the [TextRange](https://github.com/timdown/rangy/wiki/Text-Range-Module#textrange-module) module takes about 200ms to run and around 300ms on 6x throttle on chrome . This causes lag if the method is called done...
```js var searchTerm = search.inputSearch.value while (search.range.findText(searchTerm, optionsFindText)) { window.Spruce.store('searchStore').matches++ search.searchResultApplier.applyToRange(search.range) search.range.collapse(false) } ``` [Demo](https://www.loom.com/share/d1a60d5a65364892aa9e1bd7451bd6ef)
Has anyone been successful saving/restoring/highlighting selections within a shadow DOM node? I've been having issues due to the fact that selections do not cross the shadow boundary, as [specified in...
hello all, is there a way to set multiple styles for user to choose for highlighting text ? for example when user click on some yellow highlight, i take all...
@timdown will clearly explain about my functionality needed. I have a one contenteditable div element. If a user presses a Enter key, the the cotnents from the caret position to...
can we use the rangy library to highlight the dynamic documents? I have used it but the highlights are mismatching when the document is changed. Is there any way to...
I highlight the text, select it again and unhighlight it, but some letters remain highlighted. (p.s. selecting those letters and unhighlighting doesn't have any effect) (p.s. If I select a...
i'm trying to scroll to the element which is been highlighted by my class