Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibWeb: Select element will not trigger onchange when using element.value #1522

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PASS
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
gmta marked this conversation as resolved.
Show resolved Hide resolved
<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>
1 change: 0 additions & 1 deletion Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
}

Expand Down
Loading