Topic: Textarea in Accordion do not auto-resize
Joachim Kumpa priority asked 7 months ago
Expected behavior: i have an accordion with textarea. when accordion collapse the textarea should autoresize.
Actual behavior: the textarea do not resize
Kamila Pieńkowska staff answered 7 months ago
You can add listener for event that occur after collapse completly open (shown.mdb.collapse
) and resiize textarea then.
Joachim Kumpa priority commented 7 months ago
Thanks for your comment... I've thought of something like that and tried it, but no success. Can you please show me an example for the both accordions? I would be very grateful.
Kamila Pieńkowska staff commented 7 months ago
I can but, could you explain what exactly do you mean by autoresize?
Joachim Kumpa priority commented 7 months ago
When I open an accordion, the text area should be displayed at the required height (autoresize). The height depends on the content of the text. In my snippet you see what i mean. The lowest text area shows the required height. This is what it should look like when an accordion is collapsed. It should also be noted that there are several accordions on one page. Thanks for your help.
Kamila Pieńkowska staff commented 7 months ago
I'm not sure if this is what you mean but I hope it will help: https://mdbootstrap.com/snippets/standard/kpienkowska/6016940
Joachim Kumpa priority commented 7 months ago
yes, that's exactly what I mean and it's the solution I need. Many thanks.
Joachim Kumpa priority answered 7 months ago
a snippet is here
https://mdbootstrap.com/snippets/standard/kumpa/6011954#html-tab-view
can you help me please
Siddu_full_stack free commented 7 months ago
Check this out now. https://mdbootstrap.com/snippets/standard/temp/6013070
Joachim Kumpa priority commented 7 months ago
Thanks for your solution, but it's not what a mean. You changed to and this change only the width but not the height. The hight should be 8 lines by autoresize. The width in my snippet is okay because there are additional fields behind the text area. Please check out again my snippet with 2 Accordions: https://mdbootstrap.com/snippets/standard/kumpa/6011954
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 7.2.0
- Device: laptop
- Browser: Firefox, Edge
- OS: win 11
- Provided sample code: No
- Provided link: No