-
-
Notifications
You must be signed in to change notification settings - Fork 602
[CRITICAL] Fix: Infinite render loop when selecting all content (Ctrl+A / Cmd+A) #1956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CRITICAL] Fix: Infinite render loop when selecting all content (Ctrl+A / Cmd+A) #1956
Conversation
@Hector-Zhuang is attempting to deploy a commit to the TypeCell Team on Vercel. A member of the Team first needs to authorize it. |
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Hector-Zhuang this does indeed resolve the issue.
@matthewlipski can you take @Hector-Zhuang's feedback & either track it in another issue or PR. There is definitely some valid stuff in there, but I want to make a release today, so I'll take the current change as is
Reproduction Steps
Select all content manually, or use the shortcut Ctrl+A / Cmd+A.
The editor enters an infinite render loop and eventually crashes the page.
Root Cause
In the
FormattingToolbarView
update event handler, the logic attempts to check the selection boundary to determine whether the formatting toolbar is rendered.If the toolbar isn’t rendered, it forces the view to update.
When all content is selected, posToDOMRect (from Tiptap) reports a selection width of 0.
This results in the handler continuously scheduling forced updates, creating an infinite render loop.
#965
#1908