Skip to content

Commit

Permalink
add check for shape title, set editingId (#140)
Browse files Browse the repository at this point in the history
* add check for shape title, set editingId

* move setEditingId to CustomEvent

* close button works now, escape doesn't

* 1.10.7
  • Loading branch information
mdroidian authored Aug 12, 2023
1 parent 49028c0 commit fefee40
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
8 changes: 5 additions & 3 deletions src/components/TldrawCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down Expand Up @@ -653,7 +652,10 @@ class DiscourseNodeUtil extends TLBoxUtil<DiscourseNodeShape> {
}, [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",
Expand Down

0 comments on commit fefee40

Please sign in to comment.