Description
Do you want to request a feature or report a bug?
Bug - regression
What is the current behavior?
In react 16 when creating a <select size="3">
(size > 1) the first child is automatically getting marked as selected. In React 16 there does not seem to be a way to specify no gets selected by default
https://codesandbox.io/s/m76ozkwm89
What is the expected behavior?
In React 15 unless you marked an option to be selected no options were selected by default.
https://codesandbox.io/s/6894m3k9w
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Reproducible in Chrome 72 and Firefox 59.
Note: this is almost a duplicate of #12200. In fact, I copied issue text and codesandbox examples, just changing multiple
to size="3"
.
Activity
size
attribute #14242kanlanc commentedon Nov 24, 2018
Can I take this issue?
nhunzaker commentedon Feb 19, 2019
Interesting!
Here's a manual DOM example of what we're doing:
https://codepen.io/nhunzaker/pen/gqEvjj
It also looks like this is not necessary if a select is already in "multiple" mode.
nhunzaker commentedon Feb 19, 2019
@highskillzz sorry to get back late to this. #14242 is close to a fix.
gaearon commentedon Mar 22, 2019
Fixed in 16.8.5.