Skip to content

Commit

Permalink
LibWeb: Fire input event on user interaction with input element buttons
Browse files Browse the repository at this point in the history
An input event is now fired when the step up or step down button of an
input element of type number is clicked.

This ensures that any associated <output> element is updated when these
buttons are clicked.
  • Loading branch information
tcl3 committed May 18, 2024
1 parent 6349c8f commit 68660f2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@ void HTMLInputElement::create_text_input_shadow_tree()
auto up_callback_function = JS::NativeFunction::create(
realm(), [this](JS::VM&) {
MUST(step_up());
user_interaction_did_change_input_value();
return JS::js_undefined();
},
0, "", &realm());
Expand All @@ -832,6 +833,7 @@ void HTMLInputElement::create_text_input_shadow_tree()
auto down_callback_function = JS::NativeFunction::create(
realm(), [this](JS::VM&) {
MUST(step_down());
user_interaction_did_change_input_value();
return JS::js_undefined();
},
0, "", &realm());
Expand Down

0 comments on commit 68660f2

Please sign in to comment.