ngx-autosize
ngx-autosize copied to clipboard
Default Height
I am trying to set default height of text-area by setting useImportant = true. The default height I want to set is 34px but it is not working. In the inspector, it is showing 47px.
hey @msalmankarim Sorry for late answer :( busy busy haha
I am afraid that its not working like that.
I think that you should use 'minRows' as the 'default height when there is no text in the text area. But hmmmmm I am not sure how else default height should work... can you describe how you see it? What happens when we define default height and:
- text area is empty?
- text area has some text but it takes less space than default height... should we still use default height?
- text area has lots of text and calculated size is bigger than default height
best!
Hello It is not clear how default size works because even with minRows set to 1, the default calculated height equals to 2 lines.
hey @msalmankarim Sorry for late answer :( busy busy haha
I am afraid that its not working like that.
I think that you should use 'minRows' as the 'default height when there is no text in the text area. But hmmmmm I am not sure how else default height should work... can you describe how you see it? What happens when we define default height and:
- text area is empty?
- text area has some text but it takes less space than default height... should we still use default height?
- text area has lots of text and calculated size is bigger than default height
best!
Yes what I want is that to set the default height so that it can matches the other input fields in the form by default. After that if text is added and it needs more space it can resize to bigger height than the default height
Hello everyone! I have the same issue, i see what that issue have not answers from 2021.. Autor, have any ideas how the fix this bug?
My case: autosize [minRows]="3", that all option what used on textarea, but if i reload page, or set for examaple tab with this textarea to not show, textarea sizing set automaticaly to lower size (42px) why?? That case with empty textarea.
hey, Its a tricky one, can you create small example?
no problem.
Part code with autosize area
For example, i have tabs, one tab with textarea, if i set active tab with form, then i see textarea with style=height:63px;, after some seconds, this element set style=height:102px. This case happend if textarea form don't have content (empty). For first load (component) textarea have normal (original height (102px). This bug not critical for my project, but i am interest how to solve this..)
I am was tryied set all options for element, min-rows, max-rows, impotant height, nothing, anyway have the same problem. Why this happend?
Best regards!
Same issue for me
这是来自QQ邮箱的假期自动回复邮件。 亲,邮件已收到了哦