-
-
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: Don't trigger onchange event when setting <select> value
- Loading branch information
1 parent
f88aced
commit 5d00211
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Tests/LibWeb/Text/expected/HTML/HTMLSelectElement-value-change-trigger-onchange.txt
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 @@ | ||
PASS |
26 changes: 26 additions & 0 deletions
26
Tests/LibWeb/Text/input/HTML/HTMLSelectElement-value-change-trigger-onchange.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,26 @@ | ||
<!DOCTYPE html> | ||
<script src="../include.js"></script> | ||
<select id="select-test"> | ||
<option value="A"></option> | ||
<option value="B"></option> | ||
</select> | ||
<script> | ||
asyncTest(done => { | ||
const selectElement = document.getElementById("select-test"); | ||
let onchangeTriggered = false; | ||
|
||
selectElement.onchange = () => { | ||
onchangeTriggered = true; | ||
} | ||
|
||
selectElement.value = "B"; | ||
setTimeout(() => { | ||
if (!onchangeTriggered) { | ||
println("PASS"); | ||
} else { | ||
println("FAILED"); | ||
} | ||
done(); | ||
}, 1); | ||
}); | ||
</script> |
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