timdown / rangy

A cross-browser JavaScript range and selection library.
MIT License
2.24k stars 368 forks source link

findText: searching for text that does not exist within long text freezes the browser #470

Open mccarlosen opened 3 years ago

mccarlosen commented 3 years ago
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

abrehamgezahegn commented 2 years ago

Hey @mccarlosen have you found a fix for this?

mccarlosen commented 2 years ago

Hi @abrehamgezahegn sorry, I haven't found any solution...

I have found other things: When there is a long text, rangy consumes a lot of memory.

abrehamgezahegn commented 2 years ago

Hey Carlos,

Can you please let me know what other solution / library you started using? @mccarlosen

abrehamgezahegn commented 2 years ago

Thank you for getting back to me. Much appreciated.

abrehamgezahegn commented 2 years ago

@timdown anything we can do to fix his issue?