Skip to content

Commit

Permalink
Restore registerRootListener null call (#6403)
Browse files Browse the repository at this point in the history
  • Loading branch information
zurfyx authored Jul 15, 2024
1 parent 663bbd4 commit 0fbab8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/lexical/src/LexicalEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ export class LexicalEditor {
listener(this._rootElement, null);
listenerSetOrMap.add(listener);
return () => {
listener(null, this._rootElement);
listenerSetOrMap.delete(listener);
};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/lexical/src/__tests__/unit/LexicalEditor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ describe('LexicalEditor tests', () => {
await Promise.resolve().then();
});

expect(listener).toHaveBeenCalledTimes(4);
expect(listener).toHaveBeenCalledTimes(5);
expect(container.innerHTML).toBe(
'<div contenteditable="true" style="user-select: text; white-space: pre-wrap; word-break: break-word;" data-lexical-editor="true"><p><br></p></div>',
);
Expand Down

0 comments on commit 0fbab8f

Please sign in to comment.