LibWeb: Fire input event on user interaction with input element buttons
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.
This commit is contained in:
parent
a3d12e569c
commit
2a980816e7
Notes:
sideshowbarker
2024-07-17 06:09:44 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/2a980816e7 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/265
1 changed files with 2 additions and 0 deletions
|
@ -840,6 +840,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());
|
||||
|
@ -858,6 +859,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());
|
||||
|
|
Loading…
Add table
Reference in a new issue