Browse Source

fix: blur clearing editing state issue

Peng Xiao 3 years ago
parent
commit
c2c3378faa

+ 3 - 1
src/main/frontend/extensions/tldraw.cljs

@@ -70,7 +70,9 @@
     (when (and (not-empty name) (not-empty (gobj/get data "currentPageId")))
       [:div.draw.tldraw.whiteboard.relative.w-full.h-full
        {:style {:overscroll-behavior "none"}
-        :on-blur #(state/set-block-component-editing-mode! false)
+        :on-blur (fn [e] 
+                   (when (#{"INPUT" "TEXTAREA"} (.-tagName (gobj/get e "target")))
+                     (state/clear-edit!)))
         :on-drop create-block-shape-by-id
         ;; wheel -> overscroll may cause browser navigation
         :on-wheel util/stop-propagation}

+ 1 - 1
tldraw/apps/tldraw-logseq/src/styles.css

@@ -260,7 +260,7 @@
   padding: 4px;
   gap: 8px;
 
-  .tl-button:hover {
+  .tl-button:not([data-selected='true']):hover {
     background-color: var(--ls-tertiary-background-color);
   }
 }