-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Fix RichTextInput does not update when its editorOptions prop changes #9289
Conversation
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.
I ran into some warnings in the console when playing with the story:
Tippy warning
tippy.jsdestroy() was called on an already-destroyed instance. This is a no-op but indicates a potential memory leak.👷 This is a development-only message. It will be removed in production.
After selecting a tag (the popup closes) and then moving to the next record.
React warning
Warning: flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.
at RichTextInput (http://localhost:9010/ra-input-rich-text-src-RichTextInput-stories.iframe.bundle.js:1182:25)
at MyRichTextInput (http://localhost:9010/ra-input-rich-text-src-RichTextInput-stories.iframe.bundle.js:604:73)
at div
After moving to another record while the popup is still open.
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.
Navigation with keyboard is functional and the console warnings are gone, so GJ!
However, now, when I select an option in the dropdown list, then the list remains open instead of closing right away. Can you fix this too?
59a5ad8
to
b7c315f
Compare
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.
All errors fixed, nice job! 💪
When adding tiptap extensions that relies on the current record, you have to update the
editorOptions
. However the changes aren't reflected.This PR solves this by passing the
editorOptions
asuseEditor
dependencies