-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Dropdown: Not correctly refreshed when using dynamic fields #3456
Comments
To me this looks like a React Hook Form issue as manipulating the list without |
I have, response was to make sure key is properly set for each control which they should. PR says they support RHF but requires the use of controlled controls. So as I understand it this should work like this. |
I just fixed your sandbox. You were using the wrong https://codesandbox.io/s/dropdown-fix-forked-e9np1v?file=/src/Form.jsx |
Describe the bug
When creating dropdown components dynamically and then removing some, the values shown in the dropdown are incorrectly shown. They are not updated so even though the values in memory are correct they show the value that was in the location of the removed dropdown.
Reproducer
https://codesandbox.io/s/dropdown-fix-forked-om0ets?file=/src/Form.jsx
PrimeReact version
8.6.1
React version
18.x
Language
ALL
Build / Runtime
Create React App (CRA)
Browser(s)
Chrome 106
Steps to reproduce the behavior
Expected behavior
Second dropdown should show the value "Clarke".
The text was updated successfully, but these errors were encountered: