ladybird/Tests/LibWeb/Text/input/input-click-to-unfocus.html
Timothy Flynn fd297a3248 LibWeb: Run the unfocusing steps when a click does not focus anything
For example, when clicking the document body outside of a focused input
element, we should unfocus that element.
2023-12-04 01:33:57 +01:00

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>