-
-
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
[TextField] Outline has Inline Styles #13364
Comments
@tylervick This is quite a strict security policy! There is a related issue on React side: facebook/react#5878. We could change the approach. I have no object for that. But we might also want to use svg over fieldset in #13297. |
@tylervick Could you tell me more about this requirement? |
Any update on this? |
I'm not sure we should fix this issue. We are using inline style at different locations in the code base. |
The issue I have in practice with this is a display bug when the TextField changes from hidden to displayed: It's a display bug that occurs even when I force the label to be sticky:
|
I'm not familiar enough with inline styles and CSP. Is this just a concern for inputs or inline styles in general? I think it would require quite a bit of effort for our transition components to remove the inline styles. |
@AlexCppns This is a different issue. The best workaround is to change the key. It's basically the same root cause than: #15142. |
@octavioamu it works, thanks. |
I think you mean @oliviertassinari @AlexCppns :) |
ohh :p |
This issue is solved in v5. |
Using the TextField component with the variant prop set to "outlined" will inline a padding-left and width inline style. This is difficult to accommodate for Content Security Policy.
Expected Behavior
All styles provided by material-ui should be inlined in the head tag which contains a CSP nonce
Current Behavior
When implementing TextField, the following HTML is output - note the style attributes
Steps to Reproduce
Link: https://codesandbox.io/s/31prwv9j5q
Context
This makes implementing a good CSP difficult due to arbitrary inline styles
Your Environment
The text was updated successfully, but these errors were encountered: