Skip to content
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] Fixes underline custom styles not inherited by focusedUnderline. #2559

Merged
merged 1 commit into from
Dec 16, 2015

Conversation

newoga
Copy link
Contributor

@newoga newoga commented Dec 16, 2015

This fixes an issue introduced in PR #2476. I noticed in the documentation in Divider.jsx that the TextField underline were being hidden using style prop using display: 'none'. The underline was invisible when it was not focused, however when it was focused, the underline became visible. The issue was that custom styles passed to underline were not inherited by the focusedUnderline which is used when the underline has an error or is focused. Now it does (as demonstrated in lines L111-112).

Before (L111-L112):

-  let underline = Styles.merge(styles.root, style);
-  let focusedUnderline = Styles.merge(styles.root, styles.focus, focusStyle);

After (L111-L112):

+  let underline = Styles.merge(styles.root, style);
+  let focusedUnderline = Styles.merge(underline, styles.focus, focusStyle);

I also made the following minor code formatting changes:

  1. Changed Styles to styleUtils (a convention that we defined in the Divider.jsx pull request)
  2. Change styles variable from let to const (L84)

@newoga newoga changed the title Fixes underline custom styles not inherited by focusedUnderline. [TextField] Fixes underline custom styles not inherited by focusedUnderline. Dec 16, 2015
@oliviertassinari
Copy link
Member

@newoga Nice catch, thanks!

oliviertassinari added a commit that referenced this pull request Dec 16, 2015
[TextField] Fixes underline custom styles not inherited by focusedUnderline.
@oliviertassinari oliviertassinari merged commit 66a2f8f into mui:master Dec 16, 2015
@newoga newoga deleted the text-field-underline-fixes branch December 16, 2015 23:17
@zannager zannager added the component: text field This is the name of the generic UI component, not the React module! label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: text field This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants