Semantic-Org / Semantic-UI-React

The official Semantic-UI-React integration
https://react.semantic-ui.com
MIT License
13.19k stars 4.04k forks source link

Dropdown clearable sets '' as empty value. #4480

Open dominikdosoudil opened 1 month ago

dominikdosoudil commented 1 month ago

Dropdown sets '' as value when it's cleared using cross button. I think that much more sense would make null as it's meaning is literally empty value. Moreover '' makes even less sense if e.g. numbers are used as keys of other options.

https://github.com/Semantic-Org/Semantic-UI-React/blob/21cce97ec4b9e7d46615a18b18cc2cd7dce7a0a9/src/modules/Dropdown/Dropdown.js#L772

Using null as an empty value should also resolve https://github.com/Semantic-Org/Semantic-UI-React/issues/1748