material icon indicating copy to clipboard operation
material copied to clipboard

Bug: md-input-container textarea max-height/rows limitation problem

Open Nickproger opened this issue 11 years ago • 10 comments

Is there a way to limit a size of textarea with help "rows" attribute or similar?

<md-input-container>
  <label>Text</label>
  <textarea ng-model="feedback" rows="3"></textarea>
</md-input-container>

Nickproger avatar Mar 23 '15 15:03 Nickproger

+1

kikhtenko avatar Apr 06 '15 08:04 kikhtenko

+1

andreykostenko avatar Apr 06 '15 08:04 andreykostenko

+1

vovashevchenko avatar Apr 07 '15 15:04 vovashevchenko

+1

micheldlebeau avatar May 06 '15 23:05 micheldlebeau

Besides that, when the textarea is too height, when your text is down the page, it autoscroll to top, being impossible to see what you are writing. Don't know if it will be acomplished in the same scope.

ivanhtp avatar May 08 '15 18:05 ivanhtp

I have code something like this:

<md-input-container id="message" class="md-block" flex-gt-sm>
              <label>Message</label>
                  <textarea required
                            rows="10"
                            placeholder="Your message to support here"
                            ng-model="vm.email.message"
                            name="message"></textarea>
              <div ng-messages="emailSendForm.message.$error">
                <div ng-message="required">This is required.</div>
              </div>
            </md-input-container>

But still, render rows ="1" in the source ! my version: "angular-material": "1.0.9"

almothafar avatar Dec 06 '16 10:12 almothafar

+1

bialesdaniel avatar Jan 22 '17 22:01 bialesdaniel

@almothafar I reproduced your problem, I found this line that is executed after the textarea initialization, https://github.com/angular/material/blob/master/src/components/input/input.js#L471 It's weird, But I added the md-no-autogrow directive to avoid call the grow function and it's works for me.

marconi1992 avatar Mar 17 '17 17:03 marconi1992

<textarea md-detect-hidden> fixes the issue for me…

beatgrabe avatar May 12 '17 11:05 beatgrabe

That directive is documented here at the bottom, it's disabled by default for performance reasons: https://material.angularjs.org/latest/api/directive/mdInput#attributes

0xVANISHED avatar Feb 18 '19 18:02 0xVANISHED