mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-14 07:02:54 +00:00
For example, when clicking the document body outside of a focused input element, we should unfocus that element.
23 lines
537 B
HTML
23 lines
537 B
HTML
<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();
|
|
|
|
const rect = input.getBoundingClientRect();
|
|
const x = rect.x + rect.width;
|
|
const y = rect.y + rect.height;
|
|
|
|
internals.click(x + 10, y + 10);
|
|
})
|
|
</script>
|