-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[InputBase] Add prop for disabling global styles #29213
[InputBase] Add prop for disabling global styles #29213
Conversation
@material-ui/core: parsed: +Infinity% , gzip: +Infinity% |
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.
Let's give some more context on why the property should be used. Otherwise looks good 👌
Co-authored-by: Marija Najdova <mnajdova@gmail.com>
…input-base-optional-global-style
…input-base-optional-global-style
@mnajdova checking back in on this :) no rush |
@mnajdova bumping just in case it got lost |
bump again |
@mnajdova bump again |
…input-base-optional-global-style
@bryan-hunter So sorry, it seems we need to figure out how to better manage code review. Your PR shouldn't have waited this long without some sort of feedback, even if to be rejected (to save you spending time on revisions). I've asked the responsible engineering manager to step in. |
No worries, and thank you! |
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.
Sorry for the delay, I was flooded with notifications. It's a great first contribution @bryan-hunter 👌
Just a quick note for other people getting here and having performance issues with many input fields, here is how I solved it:
I think the global style injection should be memoized or something, as this is an easy trap to fall into and leaves a bad impression of the otherwise great performance of MUI... |
This causes |
Related to this discussion: #28070 (comment)
Problem:
InputBase injects / removes a global style into
<head>
on every mount / dismount to help with an auto-filling issue. This can cause initial performance rendering issues if you are loading a lot of Input components at once.Solution:
This PR introduces an optional
disableInjectingGlobalStyles
to theInputBase
component that will disable this from happening. Developers that want to leverage this, will likely want to inject these styles at the root on their app once.@mnajdova