Skip to content

Regression: React 16 automatically marks first item of a select with size > 1 as checked #14239

@kamituel

Description

@kamituel

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".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions