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

issue: validate rules shift errors #11793

Open
1 task done
Kirdock opened this issue Apr 18, 2024 · 2 comments
Open
1 task done

issue: validate rules shift errors #11793

Kirdock opened this issue Apr 18, 2024 · 2 comments
Labels
status: under investigation aware of this issue and pending for investigation

Comments

@Kirdock
Copy link

Kirdock commented Apr 18, 2024

Version Number

7.51.3

Codesandbox/Expo snack

https://codesandbox.io/p/sandbox/react-18-typescript-forked-7kqrl4?file=%2Fsrc%2Findex.tsx

Steps to reproduce

  1. Go to my Codesandbox example
  2. Click two times on "Add array element"
  3. See that as intended a "had duplicates" error is shown
  4. Select "1" in the dropdown
  5. Clear the input
  6. See that as intended the required error is shown
  7. Click on "Add array element"
  8. See the bug: The errors from element 1 shifted to element 0

If the "validate" rule of the array is removed, the shift of the errors does not occur.
Video:

Aufzeichnung.2024-04-18.114130.mp4

There is actually another bug in the sample I provided. As you can see on row 29-30 in Form.tsx, I added two state-updates as a workaround. The problem is, if the element changes right away, the next selected array element gets the values of the previous selected one.
Steps:

  1. Comment out row 29 in Form.tsx
  2. Click two times on "Add array element"
  3. Select "1" in the dropdown
  4. Change the value
  5. Select "0" in the dropdown
  6. See that the input field does not change

Video:

out.mp4

Expected behaviour

The errors don't shift

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bluebill1049 bluebill1049 added the status: under investigation aware of this issue and pending for investigation label Apr 19, 2024
@bluebill1049
Copy link
Member

why there is no input registered?

@Kirdock
Copy link
Author

Kirdock commented Apr 19, 2024

the input is dynamically registered in the Sidebar.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: under investigation aware of this issue and pending for investigation
Projects
None yet
Development

No branches or pull requests

2 participants