-
-
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
base: master
Are you sure you want to change the base?
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 |
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:
The background color is set by Chrome, we don't handle it at the moment. The fix is that the labels are correctly placed.