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

RichTextInput doesn't update on changes caused by redux-form actions #2464

Closed
manolisan opened this issue Oct 23, 2018 · 3 comments
Closed
Assignees
Labels

Comments

@manolisan
Copy link

What you were expecting:
In one view with two RichTextInput components with the same source, changing the first one should change the value of the other and vise versa.
However it is working as expected with two TextInput components with the same source, and they are in sync.

What happened instead:
Both RichTextInput component populate data on the same record in redux, but each component renders only what is typed within in it and not the value of the redux form.

Steps to reproduce:
Simply put two RichTextInput components with the same source in one SimpleForm.

Other information:

  • Looking at the code, it appears that the Quill instance is populated with data only on mount. So, when new data comes asynchronously from REDUX, the RichTextInput keeps it's initial value.
  • Remounting a RichTextInput component leads to rendering the value of the redux form.

Environment

  • React-admin version: 2.3.3
  • React version: 16.3.2
  • Browser: Chrome 69.0
@afilp
Copy link
Contributor

afilp commented Feb 12, 2019

@fzaninotto I believe that this closed (not merged) PR solves this problem, can you please re-consider this?

#2581

Thank you!

@fzaninotto
Copy link
Member

The patch in #2581 didn't seem to solve the problem. If you can provide a unit test or a CodeSandbox proving that it works, I'm willing to reconsider merging it.

@manolisan
Copy link
Author

You can check the behavior while creating a new post in this CodeSandbox.

The problem appears on the RichTextInput for engish. We have 2 of them, one in the typical create page and another one (with exaclty the same source) inside the dialog that appears when you click the translations button.

The same example with TextInput instead of RichTextInput works seamless and the 2 inputs are synchronized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants