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

TextArea with AutoResize has height of 0 if it starts as hidden #9890

Closed
adama357 opened this issue Feb 12, 2021 · 10 comments
Closed

TextArea with AutoResize has height of 0 if it starts as hidden #9890

adama357 opened this issue Feb 12, 2021 · 10 comments
Assignees
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team

Comments

@adama357
Copy link

adama357 commented Feb 12, 2021

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
https://stackblitz.com/edit/github-befymr

Current behavior
If a textarea with autoResize is generated while hidden, its height gets set to 0. (This happens whether or not the text area contains text.)

Expected behavior
Even if it's hidden, its size should be set to whatever it's supposed to be.

Minimal reproduction of the problem with instructions
See stackblitz

What is the motivation / use case for changing the behavior?
Our website displays a loading screen while a page loads, so the page is hidden while it's loading. Once the loading screen disappears, the textareas all are flat, whether or not they contain text. This will cause confusion, and unless we can find some kind of workaround, this may prevent us from upgrading to PrimeNG 11.

Relates to #9231 and #7000

Please tell us about your environment:
Windows 10

  • Angular version: 11.1

  • PrimeNG version: 11.2

  • Browser: [Chrome 88 ]

@yigitfindikli yigitfindikli added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Feb 15, 2021
@yigitfindikli yigitfindikli added this to the 11.2.3 milestone Feb 15, 2021
@yigitfindikli yigitfindikli self-assigned this Feb 15, 2021
@yigitfindikli yigitfindikli modified the milestones: 11.2.3, 11.3.0 Feb 16, 2021
@adama357
Copy link
Author

I guess the problem line is

this.el.nativeElement.style.height = this.el.nativeElement.scrollHeight + 'px';

in inputtextarea.ts. scrollHeight starts as 0 if the parent element is hidden.

A better-than-nothing solution would be to only run that line if scrollHeight is set, so it remains set to auto.

@vukwilku
Copy link

+1

@yigitfindikli yigitfindikli modified the milestones: 11.3.0-Final, 11.3.1, 11.3.2 Mar 9, 2021
@yigitfindikli yigitfindikli modified the milestones: 11.3.2, 11.3.3 Apr 5, 2021
@yigitfindikli yigitfindikli modified the milestones: 11.4.0, 11.4.1 Apr 22, 2021
@yigitfindikli yigitfindikli modified the milestones: 11.4.1, 12.Future May 11, 2021
@gstokes
Copy link

gstokes commented Aug 5, 2022

Hi, just wondering is there any plan to fix this, it's quite an old issue yet no progress on it. Thanks

@cetincakiroglu
Copy link
Contributor

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap?
Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!

Best Regards,

@mertsincan mertsincan removed this from the 14.Future milestone Nov 9, 2022
@ProfEibe
Copy link

ProfEibe commented Mar 7, 2023

no it has not been fixed!

@drekthral
Copy link

still not fixed ...(* ̄0 ̄)ノ

@Haze272
Copy link

Haze272 commented Jun 23, 2023

still not fixed!

@ProfEibe
Copy link

cetincakiroglu please reopen this issue

@BRNTZN
Copy link

BRNTZN commented Jun 28, 2023

cetincakiroglu don't know why this is closed it is still broken

@jules-js
Copy link

still appears in 16.9.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Review Issue or pull request is being reviewed by Core Team
Projects
None yet
Development

No branches or pull requests