LibWeb: Don't trigger onchange event when setting <select> value
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run

This commit is contained in:
Arhcout 2024-09-25 10:56:02 +02:00 committed by Andreas Kling
parent f88acedc8f
commit 5d00211a86
Notes: github-actions[bot] 2024-10-08 17:04:48 +00:00
3 changed files with 27 additions and 1 deletions

View file

@ -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>

View file

@ -295,7 +295,6 @@ WebIDL::ExceptionOr<void> HTMLSelectElement::set_value(String const& value)
for (auto const& option_element : list_of_options())
option_element->set_selected(option_element->value() == value);
update_inner_text_element();
queue_input_and_change_events();
return {};
}