4 Answers, 1 is accepted
By setting popupSettings.height to 'auto', the browser will calculate it for you. Here is an example - https://stackblitz.com/edit/react-xa5jqs?file=app/main.jsx.
Still isn't what I'm looking for - I need something like maxHeight
I'm trying to build filtering and when It contains many elements,- It should show scroll, otherwise should work like height auto.
Maybe smth like this
popupSettings.height = items.length > 5 ? '100' : 'auto' ?
Would It work properly
Thank you for the clarification.
The height property actually sets max-height CSS rules instead of height:
This means, that setting it will show scrolling when there are many items and automatically remove it when there are less items.