ladybird/Tests/LibWeb/Text/input/HTML/Window-find-clear-selection.html
Tim Ledbetter 9e556972ae LibWeb: Reset find-in-page index if selection is cleared
Previously, if the user made a find-in-page query, then cleared the
selection made by that query, subsequent queries would inadvertently
advance to the next match instead of reselecting the first match.
2025-02-09 18:19:58 +00:00

12 lines
398 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<div>test</div>
<script>
test(() => {
let result = window.find("test");
println(`window.find("test") initial result: ${result}`);
window.getSelection().removeAllRanges();
result = window.find("test");
println(`window.find("test") after clearing the previous selection: ${result}`);
});
</script>