-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[material-ui][TextField] Fix filled state to be synced with autofill #44135
Conversation
Netlify deploy previewhttps://deploy-preview-44135--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
@aarongarciah, in #36448 (comment), I mention that the eventual correct solution to this is relying on the |
Sadly, testing autofill is not supported ATM in Playwright: microsoft/playwright#26831. Testing with |
@DiegoAndai Would it be possible to mimic the behavior in jsdom? We have fine grained control over which events fire exactly. |
While trying to figure out how to test this, I realized there's another problem here I hadn't considered: The controlled state is unsynced until user interaction: Screen.Recording.2024-10-17.at.14.47.28.movThis has not yet been solved in this PR. I'm putting it on hold and come back to it after my OOO period. |
These lines in Related issues: #14453, #14427 An alternative way relies on doing a computed style check, though we probably don't want to incur the performance cost on TextField: https://github.com/clerk/javascript/pull/4560/files |
I finally got the time to get back to this one.
I propose merging this PR to fix the Ready for review @Janpot @aarongarciah |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement!
Revert some of the
TextField
changes in #34849.Fixes #36448
Explanation of the fix: #36448 (comment)
Repro instructions:
TextField
s and submitBefore
Sandbox: https://codesandbox.io/p/sandbox/pr-44135-before-zrzxy8
State after reload:
After
Sandbox: https://codesandbox.io/p/sandbox/pr-44135-after-48gdc3
State after reload: