1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:37:35 +00:00

LibWeb: Focus the document element when unfocusing an element

Otherwise, the currently focused element remains focused.
This commit is contained in:
Timothy Flynn 2023-12-03 09:12:12 -05:00 committed by Andreas Kling
parent 3c0c300039
commit 48240a6fc3
3 changed files with 23 additions and 1 deletions

View file

@ -0,0 +1,18 @@
<input id=input type=text>
<script src="include.js"></script>
<script>
test(() => {
let input = document.getElementById("input");
input.addEventListener("focus", () => {
println("focus");
});
input.addEventListener("blur", () => {
println("blur");
});
input.focus();
input.blur();
})
</script>