From 051d58011ef1f7e3f07b95b155554a95f5452807 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 27 Jan 2022 08:00:57 -0800 Subject: [PATCH] fix: Regression in collapsible headings closes #3010 --- shared/editor/nodes/Heading.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/editor/nodes/Heading.ts b/shared/editor/nodes/Heading.ts index 8fbdf2eee..983590c24 100644 --- a/shared/editor/nodes/Heading.ts +++ b/shared/editor/nodes/Heading.ts @@ -117,14 +117,14 @@ export default class Heading extends Node { handleFoldContent = (event: MouseEvent) => { event.preventDefault(); - if (!(event.target instanceof HTMLButtonElement)) { + if (!(event.currentTarget instanceof HTMLButtonElement)) { return; } const { view } = this.editor; const hadFocus = view.hasFocus(); const { tr } = view.state; - const { top, left } = event.target.getBoundingClientRect(); + const { top, left } = event.currentTarget.getBoundingClientRect(); const result = view.posAtCoords({ top, left }); if (result) {