Skip to content

Commit bd9a9af

Browse files
committed
Change DropdownField selectedOptions to not replace null value with default
To allow null values in sort options to not be first in list.
1 parent 7abed3c commit bd9a9af

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/js/components/Fields/DropdownField.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default class DropdownField extends React.Component {
9191

9292
if (optionsProp) {
9393
// Value not set, default to first option
94-
if (value === null || value === undefined) {
94+
if (value === undefined) {
9595
selectedOptions = [optionsProp[0]];
9696
} else if (this.isMultiSelect()) {
9797
for (const multiSelectValue of value) {
@@ -174,7 +174,7 @@ export default class DropdownField extends React.Component {
174174
<div
175175
className={`dropdown-field__options__item ${option.className ? option.className : ''}`}
176176
key={option.value}
177-
onClick={(e) => this.handleChange(option.value, is_selected)}
177+
onClick={(e) => this.handleChange(option.value, is_selected)}
178178
>
179179
{!no_status_icon && is_selected && selected_icon}
180180
{option.label}

0 commit comments

Comments
 (0)