Browse Source

LibWeb: Readonly input element's arrow buttons don't change the value

Arhcout 9 months ago
parent
commit
c31f9815b4
1 changed files with 8 additions and 4 deletions
  1. 8 4
      Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp

+ 8 - 4
Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp

@@ -876,8 +876,10 @@ 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();
+                if (m_is_mutable) {
+                    MUST(step_up());
+                    user_interaction_did_change_input_value();
+                }
                 return JS::js_undefined();
             },
             0, "", &realm());
@@ -896,8 +898,10 @@ 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();
+                if (m_is_mutable) {
+                    MUST(step_down());
+                    user_interaction_did_change_input_value();
+                }
                 return JS::js_undefined();
             },
             0, "", &realm());