Browse Source

fix: can't type space in a whiteboard block

Fixes LOG-3134
Tienson Qin 1 year ago
parent
commit
ef92c0be63

+ 2 - 2
packages/tldraw/apps/tldraw-logseq/src/components/QuickLinks/QuickLinks.tsx

@@ -23,8 +23,8 @@ export const QuickLinks: TLQuickLinksComponent<Shape> = observer(({ shape }) =>
     // do not show links for the current page
     return links.filter(
       link =>
-        link[0].toLowerCase() !== app.currentPage.name &&
-        handlers.getBlockPageName(link[0]) !== app.currentPage.name
+        link[0].toLowerCase() !== app.currentPage.id &&
+        link[0] !== shape.props.pageId
     )
   }, [shape.props.id, shape.props.type, shape.props.parentId, shape.props.refs])
 

+ 1 - 1
packages/tldraw/packages/core/src/lib/TLSettings.ts

@@ -17,7 +17,7 @@ export class TLSettings implements TLSettingsProps {
 
   @observable mode: 'dark' | 'light' = 'light'
   @observable showGrid = true
-  @observable snapToGrid = true
+  @observable snapToGrid = false
   @observable penMode = false
   @observable scaleLevel = 'md'
   @observable color = ''

+ 0 - 1
src/main/frontend/components/block.cljs

@@ -2166,7 +2166,6 @@
           meta? (util/meta-key? e)
           forbidden-edit? (target-forbidden-edit? target)]
       (when (and (not forbidden-edit?) (contains? #{1 0} button))
-        (util/stop-propagation e)
         (let [selection-blocks (state/get-selection-blocks)
               starting-block (state/get-selection-start-block-or-first)]
           (cond

+ 1 - 0
src/main/frontend/handler/whiteboard.cljs

@@ -284,6 +284,7 @@
   {:blockType (if (parse-uuid (str block-id)) "B" "P")
    :id (str (d/squuid))
    :compact false
+   ;; Why calling it pageId when it's actually a block id?
    :pageId (str block-id)
    :point point
    :size [400, 0]