Skip to content

Commit f106f8b

Browse files
committed
fix(pf3): display placeholder for pre-selected lazy options.
1 parent 0588153 commit f106f8b

File tree

1 file changed

+6
-1
lines changed
  • packages/pf3-component-mapper/src/files/select

1 file changed

+6
-1
lines changed

packages/pf3-component-mapper/src/files/select/select.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ const getDropdownText = (value, placeholder, options) => {
5353
return [placeholder, true];
5454
}
5555

56-
return [options.find((option) => option.value === value).label, false];
56+
const selectedOption = options.find((option) => option.value === value);
57+
if (!selectedOption) {
58+
return [placeholder, true];
59+
}
60+
61+
return [selectedOption.label, false];
5762
};
5863

5964
class SearchInput extends Component {

0 commit comments

Comments
 (0)