fix: Regression in collapsible headings

closes #3010
This commit is contained in:
Tom Moor
2022-01-27 08:00:57 -08:00
parent 6d987975bc
commit 051d58011e

View File

@@ -117,14 +117,14 @@ export default class Heading extends Node {
handleFoldContent = (event: MouseEvent) => { handleFoldContent = (event: MouseEvent) => {
event.preventDefault(); event.preventDefault();
if (!(event.target instanceof HTMLButtonElement)) { if (!(event.currentTarget instanceof HTMLButtonElement)) {
return; return;
} }
const { view } = this.editor; const { view } = this.editor;
const hadFocus = view.hasFocus(); const hadFocus = view.hasFocus();
const { tr } = view.state; const { tr } = view.state;
const { top, left } = event.target.getBoundingClientRect(); const { top, left } = event.currentTarget.getBoundingClientRect();
const result = view.posAtCoords({ top, left }); const result = view.posAtCoords({ top, left });
if (result) { if (result) {