mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
LibWeb: Update number input on mousedown of number input buttons
This matches the behavior of other browsers. Previously, a click event was used, so the value was only updated when the mouse was released.
This commit is contained in:
parent
2a980816e7
commit
b4b947c607
Notes:
sideshowbarker
2024-07-17 03:18:29 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/b4b947c607 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/265
1 changed files with 2 additions and 2 deletions
|
@ -845,7 +845,7 @@ void HTMLInputElement::create_text_input_shadow_tree()
|
|||
},
|
||||
0, "", &realm());
|
||||
auto up_callback = realm().heap().allocate_without_realm<WebIDL::CallbackType>(*up_callback_function, Bindings::host_defined_environment_settings_object(realm()));
|
||||
up_button->add_event_listener_without_options(UIEvents::EventNames::click, DOM::IDLEventListener::create(realm(), up_callback));
|
||||
up_button->add_event_listener_without_options(UIEvents::EventNames::mousedown, DOM::IDLEventListener::create(realm(), up_callback));
|
||||
|
||||
// Down button
|
||||
auto down_button = MUST(DOM::create_element(document(), HTML::TagNames::button, Namespace::HTML));
|
||||
|
@ -864,7 +864,7 @@ void HTMLInputElement::create_text_input_shadow_tree()
|
|||
},
|
||||
0, "", &realm());
|
||||
auto down_callback = realm().heap().allocate_without_realm<WebIDL::CallbackType>(*down_callback_function, Bindings::host_defined_environment_settings_object(realm()));
|
||||
down_button->add_event_listener_without_options(UIEvents::EventNames::click, DOM::IDLEventListener::create(realm(), down_callback));
|
||||
down_button->add_event_listener_without_options(UIEvents::EventNames::mousedown, DOM::IDLEventListener::create(realm(), down_callback));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue