-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
good first issueGreat for first contributions. Enable to learn the contribution process.Great for first contributions. Enable to learn the contribution process.scope: text fieldChanges related to the text field.Changes related to the text field.type: bugIt doesn't behave as expected.It doesn't behave as expected.
Description
Current Behavior 😯
When we build an application in production and we add the variable at true for disableGlobal inside createGenerateClassName, TextField is shrinked automatically by default without value.
Expected Behavior 🤔
Should not be shrinked.
Steps to Reproduce 🕹
https://codesandbox.io/s/material-ui-error-input-4y9hv
Doesn't work on chrome and firefox but works on Safari. If you put disableGlobal at false it's work everywhere
eps1lon, martinjlowm and oliviertassinari
Metadata
Metadata
Assignees
Labels
good first issueGreat for first contributions. Enable to learn the contribution process.Great for first contributions. Enable to learn the contribution process.scope: text fieldChanges related to the text field.Changes related to the text field.type: bugIt doesn't behave as expected.It doesn't behave as expected.
Projects
Milestone
Relationships
Development
Select code repository
Activity
oliviertassinari commentedon Jan 14, 2020
Wow, this is an amazing side effect (unexpected). If somebody wants to investigate, it can start here:
https://github.com/mui-org/material-ui/blob/e4f33b7c1bf8997af08b7e60def224c4fa75c719/packages/material-ui/src/InputBase/InputBase.js#L391
val2207 commentedon Jan 14, 2020
^^ yes ! If you move your mouse on the page (codesandbox) then you refresh the page on the same time most of time it works ! If you stop moving and you refresh you got the error again. :S
martinjlowm commentedon Jan 30, 2020
The use of
indexOf
should reference the JSS generated name, rather than the static name as it currently does. It would be straightforward ifwithStyles
andmakeStyles
exposed the generated CSS sheet and referenced the keyframe name as is described here: https://cssinjs.org/jss-syntax/?v=v10.0.3#keyframes-animationOne proposal is an extra option, similar to how the inclusion option of theme is done, e.g.
withStyles({ ... }, { withTheme: true, withSheet: true })
. The sheet is thestaticSheet
generated here: https://github.com/mui-org/material-ui/blob/bdebdfd4832c13a05463faeffef9687688be9715/packages/material-ui-styles/src/makeStyles/makeStyles.js#L87staticSheet.keyframes['auto-fill-cancel']
reveals the generated name. Any thoughts on this solution?oliviertassinari commentedon Jan 30, 2020
We will soon have to solve the same issue with styled-components and emotion (multi-engine support). They both give us access to the generated name of the keyframe but with our current integration with JSS, it's more challenging. In this context, what about we use global, prefixed, names?
martinjlowm commentedon Jan 31, 2020
I agree, it seems like a cleaner approach.
It feels bloated having to supply the sheet as I proposed for one particular use-case.
oliviertassinari commentedon Jan 31, 2020
@martinjlowm Great, in this case, feel free to take the lead to get these changes in the master branch :).
[-]TextField Label shrinked on Chrome and Firefox[/-][+][TextField] Label shrink issue with disableGlobal: true[/+]