mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
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.
This commit is contained in:
parent
5f10f8c54c
commit
9e556972ae
Notes:
github-actions[bot]
2025-02-09 18:20:56 +00:00
Author: https://github.com/tcl3
Commit: 9e556972ae
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3496
Reviewed-by: https://github.com/nico
Reviewed-by: https://github.com/trflynn89
3 changed files with 37 additions and 22 deletions
|
@ -0,0 +1,12 @@
|
|||
<!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>
|
Loading…
Add table
Add a link
Reference in a new issue