ngx-autosize icon indicating copy to clipboard operation
ngx-autosize copied to clipboard

Default Height

Open msalmankarim opened this issue 3 years ago • 8 comments

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.

image

image

msalmankarim avatar Mar 03 '21 13:03 msalmankarim

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!

chrum avatar Jul 20 '21 12:07 chrum

Hello It is not clear how default size works because even with minRows set to 1, the default calculated height equals to 2 lines.

roxteddy avatar Jul 29 '21 09:07 roxteddy

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

msalmankarim avatar Sep 10 '21 14:09 msalmankarim

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.

derzhimorda avatar Jan 30 '23 09:01 derzhimorda

hey, Its a tricky one, can you create small example?

chrum avatar Jan 30 '23 10:01 chrum

no problem.

Part code with autosize area

image

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!

derzhimorda avatar Jan 31 '23 12:01 derzhimorda

Same issue for me

GregoireKarydes avatar Feb 16 '23 14:02 GregoireKarydes

这是来自QQ邮箱的假期自动回复邮件。   亲,邮件已收到了哦

haoqiangqiang avatar Feb 16 '23 14:02 haoqiangqiang