-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
feat: ion-textarea minRows/maxRows #18543
Comments
Thanks for the feature request! It looks like you can use I created a CodePen here: https://codepen.io/liamdebeasi/pen/wLMvGv Does this work for your use case? Thanks! |
I am away from my computer at the moment. I will follow up with this and let you know. |
Hi, @liamdebeasi While that does technically has the desired effect the other problem is working with it natively. Once it reaches the maximum height and you continue type after each new line, once the word is typed and press (space) then the view is scrolled to the top of the ion-textarea and then once you continue typing it will scroll back to the bottom. Meanwhile the button that I have inside will scroll up with the text, hiding the button. This issue doesn't happen on the desktop, but, only natively. |
Thanks for the follow up! Would you be able to provide a code example of how that would work with the native Thanks! |
hi @liamdebeasi Sorry I don't know what you mean exactly. I implemented the max-height as you suggested in the codepen above. The implementation that I was inferring was that of the
here is a small Stackblitz with the implementation |
Here is an implementation of a React wrapper component that does the job for me. Anyone facing this problem may try out the solution (or work out something similar in angular):
|
Thanks for the issue. This has been resolved via #21333, and a fix will be available in an upcoming release of Ionic Framework. Rather than expose a CSS variable for this, we were able to accomplish this via style inheritance. This allows developers to set max/min height and widths on the Usage Example: ion-textarea {
max-height: 300px;
min-height: 100px;
} |
with:
I've tried adding some styles to overwrite the current framework styles:
but the element height seems to be overriding:
anything else I can try in the meantime? or just wait for the framework update? |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Feature Request
Ionic version:
[x] 4.x
Describe the Feature Request
according to the docs there is a
rows
andcols
attributes but there is nomaxRows
andmaxCols
the former being important bing very useful when dealing with native since if someone writes a message or something that is longer I don't want theautoGrow
directive to take over the entire screenDescribe Preferred Solution
essentially it would be nice to have these abilities to impliment instead of using a 3rd party package to fulfill a min/max rows/cols
Describe Alternatives
Related Code
current implementation:
desired outcome:
Additional Context
The text was updated successfully, but these errors were encountered: