Skip to content
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

Don't reset RichTextEditor document upon content prop changes, but do so with RichTextReadOnly #98

Merged
merged 4 commits into from
Jul 15, 2023

Conversation

sjdemartini
Copy link
Owner

@sjdemartini sjdemartini commented Jul 15, 2023

  • RichTextEditor now will not reset the editor's document content when its content prop changes. This should make the component more generally flexible, with the option for users to customize when/how they want to setContent. See the new README section on "Re-rendering RichTextEditor when content changes" for more details and alternative approaches. (This is all related to the discussion here The cursor jumps to the end of the content when using React Hook Form #91 (comment).)
  • RichTextReadOnly now will reset the editor's document content when its content prop changes. This is how it should've worked all along, since it's read-only and should be treated as a more "pure" renderer.
  • README has been updated with more details about when/how to use these two components.
  • There are additional tips on editor extensions in the README, in a slightly improved format.

This is related to the discussion here
#91, and should make the
component more generally flexible, with the option for users to
customize when/how they want to `setContent`.
@sjdemartini sjdemartini merged commit b2acb48 into main Jul 15, 2023
@sjdemartini sjdemartini deleted the content-updates-improvements branch July 15, 2023 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant