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

fix(input): incorrect height with autosize #4084

Merged
merged 2 commits into from
Apr 14, 2017

Commits on Apr 13, 2017

  1. fix(input): incorrect height with autosize

    Currently when using the `mdTextareaAutosize` directive the textarea height might be incorrect on component initialization.
    
    This happens because the textarea `scrollHeight` property is not ready in the `ngOnInit` lifecycle hook yet.
    
    Other libraries like `angular-elastic` have timeouts for that. But using the `ngAfterViewInit` lifecycle hook is more elegant and also ensures that the `scrollHeight` property is ready.
    
    Also switches `offsetHeight` to `clientHeight` since we don't want to include the border in our line-height calculations.
    
    Also by default `textarea` elements have a padding of `2px` and the `padding` needs to be explicitly set to `0px` when resolving the line-height.
    
    Fixes angular#4070.
    devversion committed Apr 13, 2017
    Configuration menu
    Copy the full SHA
    9b812bc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a8c3781 View commit details
    Browse the repository at this point in the history