-
-
Notifications
You must be signed in to change notification settings - Fork 980
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibWeb: Prevent checkboxes from firing change events when losing focus
This is because toggling the checkbox is committing the value.
- Loading branch information
1 parent
c898ee9
commit 3856dd9
Showing
3 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
16 changes: 16 additions & 0 deletions
16
Tests/LibWeb/Text/input/checkbox-focus-lost-no-change-event.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |