mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 07:37:03 +00:00
LibWeb: Prevent checkboxes from firing change events when losing focus
This is because toggling the checkbox is committing the value.
This commit is contained in:
parent
c898ee90cf
commit
3856dd946b
Notes:
github-actions[bot]
2024-11-18 08:05:07 +00:00
Author: https://github.com/Psychpsyo
Commit: 3856dd946b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2379
3 changed files with 17 additions and 0 deletions
|
@ -0,0 +1,16 @@
|
|||
<!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>
|
Loading…
Add table
Add a link
Reference in a new issue