You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What you were expecting:
In an EditForm with an ArrayInput all input fields show the given record values. This also holds for conditionally rendered field values if the condition is fullfilled and the shouldUnregister property is set to true.
What happened instead:
Having the following complex EditForm.
There is an ArrayInput.
One field of the array elements is only conditionally rendered depending on the value of another. Then the value of the conditionally rendered input field is not displayed (even though the field itself is rendered). This only happens if the shouldUnregister property is set to true for the conditionally rendered input field.
Steps to reproduce:
Open this code sandbox.
Go to the comments records and open one of the comments. The value in the field "Bar" is not shown even though we would expect to see "world" there. If the "shouldUnregister" property is removed in the CommentEdit.tsx (line 166) the value is displayed correctly. However, then we would lose the unregister functionality of the field.
Hint: Starting from the provided example code sandbox for v5 we only changed the data.tsx and CommendEdit.tsx to provide the example.
Environment
React-admin version: 5.1.3
Last version that did not exhibit the issue (if applicable): 4.16.20
React version: 18.3.1
Browser: Chrome, Firefox
The text was updated successfully, but these errors were encountered:
What you were expecting:
In an EditForm with an ArrayInput all input fields show the given record values. This also holds for conditionally rendered field values if the condition is fullfilled and the
shouldUnregister
property is set totrue
.What happened instead:
Having the following complex EditForm.
There is an ArrayInput.
One field of the array elements is only conditionally rendered depending on the value of another. Then the value of the conditionally rendered input field is not displayed (even though the field itself is rendered). This only happens if the
shouldUnregister
property is set to true for the conditionally rendered input field.We just upgraded from [email protected] (where everything worked) to [email protected] where the bug occurs. In both cases we use [email protected]
Steps to reproduce:
Open this code sandbox.
Go to the comments records and open one of the comments. The value in the field "Bar" is not shown even though we would expect to see "world" there. If the "shouldUnregister" property is removed in the
CommentEdit.tsx
(line 166) the value is displayed correctly. However, then we would lose the unregister functionality of the field.Hint: Starting from the provided example code sandbox for v5 we only changed the
data.tsx
andCommendEdit.tsx
to provide the example.Environment
The text was updated successfully, but these errors were encountered: