I have a multiline input with lots of text. The min height is 40px. I want it to fit height to content based on a condition. The condition is when I press a button called ‘show all content’.
Pretty simple I would say, but no idea how to do it. Anyone got some ideas?
A workaround is to just have two multiline inputs. Let’s call them A and B.
Set states initialContentA+B to the relevant text on page load / button click or whatever.
A initial content = state initialContentA
B initial content = state initialContentB
Do when A’s value is changed - set initial content of B to A’s value and reset group containing B
Do when B’s value is changed - set initial content of A to B’s value and reset group containing A
This will keep both inputs synced. When show all content is clicked, hide A and show B.
This topic was automatically closed after 70 days. New replies are no longer allowed.