I have a select with a fixed width but I need to change the height of the select to fit the all the options, so that the entire option text is shown rather than it being cut off. I have tried setting the height to an arbitary value of 80px
and adding whitespace:pre-wrap
which works but this means that the shorter options are obviously still 80px tall so they take up more room than they need to.
Below is an example of a select that I am trying to work with.
<select style='padding: 0.5rem; white-space:pre-wrap; width: 100%; height:80px;'>
<option>Text 1</option>
<option>Text 1 Lots of additional text that needs additional room</option>
<option>Text 1 Some extra text</option>
</select>