mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
LibWeb: Don't trigger onchange event when setting <select> value
This commit is contained in:
Notes:
github-actions[bot]
2024-10-08 17:04:48 +00:00
Author: https://github.com/Arhcout Commit: https://github.com/LadybirdBrowser/ladybird/commit/5d00211a860 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1522 Reviewed-by: https://github.com/gmta ✅
@@ -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>
|
||||
Reference in New Issue
Block a user