Files
ladybird/Tests/LibWeb/Text/input/checkbox-focus-lost-no-change-event.html
Psychpsyo 3856dd946b LibWeb: Prevent checkboxes from firing change events when losing focus
This is because toggling the checkbox is committing the value.
2024-11-18 09:04:11 +01:00

16 lines
463 B
HTML

<!DOCTYPE html>
<input type="checkbox" id="checkbox">
<script src="include.js"></script>
<script>
checkbox.addEventListener("change", () => {
println("Change event was fired when it shouldn't have been.");
});
asyncTest(async done => {
checkbox.focus();
await new Promise(resolve => setTimeout(resolve, 0));
checkbox.blur();
await new Promise(resolve => setTimeout(resolve, 0));
done();
});
</script>