Skip to content

Commit

Permalink
fix: Open HTML editor on dblclick
Browse files Browse the repository at this point in the history
stopped working after #276
  • Loading branch information
surajshetty3416 committed Jan 27, 2025
1 parent 4fe7d26 commit 0d60256
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/utils/useBlockEventHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export function useBlockEventHandlers() {
// dblclick on container adds text block or selects text block if only one child
let children = block.getChildren();
if (block.isHTML()) {
// editor.value?.element.dispatchEvent(new MouseEvent("dblclick", e));
document
.querySelector(`.editor[data-block-id="${block.blockId}"]`)
?.dispatchEvent(new MouseEvent("dblclick", e));
e.stopPropagation();
} else if (block.isContainer()) {
if (!children.length) {
Expand Down

0 comments on commit 0d60256

Please sign in to comment.