From fefee401ede868ef7ac35a6d5fa234c045c3584c Mon Sep 17 00:00:00 2001 From: Michael Gartner Date: Fri, 11 Aug 2023 21:01:13 -0700 Subject: [PATCH] add check for shape title, set editingId (#140) * add check for shape title, set editingId * move setEditingId to CustomEvent * close button works now, escape doesn't * 1.10.7 --- package-lock.json | 4 ++-- package.json | 2 +- src/components/TldrawCanvas.tsx | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 21304585..dda39624 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "query-builder", - "version": "1.10.6", + "version": "1.10.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "query-builder", - "version": "1.10.6", + "version": "1.10.7", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index b115047f..2e0e4edc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "query-builder", - "version": "1.10.6", + "version": "1.10.7", "description": "Introduces new user interfaces for building queries in Roam", "main": "./build/main.js", "author": { diff --git a/src/components/TldrawCanvas.tsx b/src/components/TldrawCanvas.tsx index 22caea6d..e41d9f12 100644 --- a/src/components/TldrawCanvas.tsx +++ b/src/components/TldrawCanvas.tsx @@ -373,9 +373,8 @@ const LabelDialog = ({ isOpen={isOpen} title={"Edit Discourse Node Label"} onClose={onCancelClick} - // Clicking the close button Wasn't working?? - isCloseButtonShown={false} canOutsideClickClose + // Escape isn't working? canEscapeKeyClose autoFocus={false} className={"roamjs-discourse-playground-dialog"} @@ -653,7 +652,10 @@ class DiscourseNodeUtil extends TLBoxUtil { }, [setLoaded, loaded, contentRef, shape.props.uid]); useEffect(() => { const listener = (e: CustomEvent) => { - if (e.detail === shape.id) setIsEditLabelOpen(true); + if (e.detail === shape.id) { + setIsEditLabelOpen(true); + this.app.setEditingId(shape.id); + } }; document.body.addEventListener( "roamjs:query-builder:created-canvas-node",