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: Fields dirty state is not updated when passing values to useForm since 7.51.0 #11794

Closed
1 task done
djhi opened this issue Apr 18, 2024 · 8 comments
Closed
1 task done
Labels
regression Regression with code change

Comments

@djhi
Copy link

djhi commented Apr 18, 2024

Version Number

7.51.0

Codesandbox/Expo snack

https://codesandbox.io/p/sandbox/control-forked-stnhsf

Steps to reproduce

To reproduce, change the value of the only input and observe the isDirty value displayed by the IsolateReRender component. It stays false

Expected behaviour

It should be set to true.

I actually set up two sandboxes:

The issue is still present in v7.51.3.

This breaks all react-admin applications.

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bluebill1049 bluebill1049 added status: under investigation aware of this issue and pending for investigation regression Regression with code change labels Apr 19, 2024
@bluebill1049
Copy link
Member

bluebill1049 commented Apr 19, 2024

thanks, for the report, looks like the issue is already fixed: https://codesandbox.io/p/sandbox/control-forked-5fys45?file=%2Fsrc%2FApp.tsx%3A9%2C20 related issue: #11778

I will release a patch for this soon.

@bluebill1049 bluebill1049 removed the status: under investigation aware of this issue and pending for investigation label Apr 19, 2024
@djhi
Copy link
Author

djhi commented Apr 19, 2024

There's something I don't understand though. My second sandbox (https://codesandbox.io/p/sandbox/control-forked-stnhsf) uses 7.51.3 just like yours, yet it has the same issue but yours don't. Besides, I don't see any differences between the two.

@slax57
Copy link

slax57 commented Apr 19, 2024

There's something I don't understand though. My second sandbox (https://codesandbox.io/p/sandbox/control-forked-stnhsf) uses 7.51.3 just like yours, yet it has the same issue but yours don't. Besides, I don't see any differences between the two.

That's because the fixed sandbox imports from ./src and not from react-hook-form

@djhi
Copy link
Author

djhi commented Apr 29, 2024

There's something I don't understand though. My second sandbox (https://codesandbox.io/p/sandbox/control-forked-stnhsf) uses 7.51.3 just like yours, yet it has the same issue but yours don't. Besides, I don't see any differences between the two.

That's because the fixed sandbox imports from ./src and not from react-hook-form

Good catch, thanks :)

@djhi
Copy link
Author

djhi commented May 2, 2024

@bluebill1049 Any chance to have a release soon? 🙏

@bluebill1049
Copy link
Member

@bluebill1049 Any chance to have a release soon? 🙏

yes, sorry I am on a break.

@djhi
Copy link
Author

djhi commented May 7, 2024

Hi @bluebill1049! Thank you for the release. It does not seem to be fixed though 😭
https://codesandbox.io/p/sandbox/control-forked-stnhsf

@TheWirv
Copy link

TheWirv commented May 8, 2024

I have breaking unit tests because a CSS class is applied based on the isDirty state, and I check in the tests, whether the class is applied or not.

I have logged some of the data while rendering the component, and this is the final state, with version 7.51.4:
image

I have executed the same test on an older version (I am trying to upgrade package versions for our project right now) and there it works fine, with version 7.15.4:
image

Both use the same userEvent.type API from the user event testing library.

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

No branches or pull requests

4 participants