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] Fix initial scroll #7260

Merged
merged 1 commit into from
Jun 27, 2017

Conversation

brendanmh
Copy link

@brendanmh brendanmh commented Jun 26, 2017

Closes #7175

The height of the TextField was not taking into account the size of the value when the TextField was first rendered.

The code looks at the height of the hintText, or, if the value has changed, it looks at the height of the value.

Made changes so that the value is passed into the function that is calculating the height, both when the component is mounted, or the component is resized.

I have had to skip a unit test because jsdom does not support scrollHeight. The unit test code is within the test file, and could be "unskipped" later if jsdom can do layout, or another engine is used.

  • PR has tests / docs demo, and is linted.
  • Commit and PR titles begin with [ComponentName], and are in imperative form: "[Component] Fix leaky abstraction".
  • Description explains the issue / use-case resolved, and auto-closes the related issue(s) (http://tr.im/vFqem).

The height of the TextField was not taking into account the size of the value when the TextField was first rendered.

The code looks at the height of the hintText, or, if the value has changed, it looks at the height of the value.

Made changes so that the value is passed into the function that is calculating the height, both when the component is mounted, or the component is resized.

I have had to skip a unit test because jsdom does not support scrollHeight. The unit test code is within the test file, and could be "unskipped" later if jsdom can do layout, or another engine is used.
@oliviertassinari oliviertassinari merged commit 4974ba1 into mui:master Jun 27, 2017
@oliviertassinari oliviertassinari changed the title [TextField] Issue 7175 [TextField] Fix initial scroll Jun 27, 2017
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module! PR: Review Accepted labels Jun 27, 2017
@oliviertassinari
Copy link
Member

@brendanmh Thanks

djbuckley added a commit to manchesergit/material-ui that referenced this pull request Jun 28, 2017
* call_em_all_-_master/master:
  [docs] Promote the v1.0.0-alpha (mui#7273)
  Issue 7175 (mui#7260)
  Fix regressions (mui#7262)
  [tests] correct values expected by autoprefixer (mui#7267)

# Conflicts:
#	src/internal/FocusRipple.js

* fixed step to have a default array of no children, as without it the tests were failing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work 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.

2 participants