Browse Source

fix: stop event when pressing enter or space on a property value

Tienson Qin 1 year ago
parent
commit
e7562e0853
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/main/frontend/components/property/value.cljs

+ 4 - 0
src/main/frontend/components/property/value.cljs

@@ -614,6 +614,10 @@
        :div.jtrigger.flex.flex-1.w-full
        {:ref *el
         :tabIndex 0
+        :on-key-down (fn [^js e]
+                       (when (contains? #{"Enter" " "} (.-key e))
+                         (.click (.-target e))
+                         (util/stop e)))
         :on-click #(show! (.-target %))}
        (if (string/blank? value)
          (property-empty-value)