Rocket.Chat.ReactNative/patches/react-native-picker-select+...

31 lines
1.3 KiB
Diff
Raw Normal View History

2020-02-11 14:01:35 +00:00
diff --git a/node_modules/react-native-picker-select/src/index.js b/node_modules/react-native-picker-select/src/index.js
index 4f50605..6df9757 100644
--- a/node_modules/react-native-picker-select/src/index.js
+++ b/node_modules/react-native-picker-select/src/index.js
@@ -135,7 +135,7 @@ export default class RNPickerSelect extends PureComponent {
}
return {
- ...(itemsChanged ? { items } : {}),
+ ...(itemsChanged ? { items: !isEqual(selectedItem, {}) ? items.filter(item => item.value !== null) : items } : {}),
...(selectedItemChanged ? { selectedItem } : {}),
};
}
@@ -146,6 +146,7 @@ export default class RNPickerSelect extends PureComponent {
constructor(props) {
super(props);
+
const items = RNPickerSelect.handlePlaceholder({
placeholder: this.props.placeholder,
}).concat(this.props.items);
@@ -157,7 +158,7 @@ export default class RNPickerSelect extends PureComponent {
});
this.state = {
- items,
+ items: !isEqual(selectedItem, {}) ? items.filter(item => item.value !== null) : items,
selectedItem,
showPicker: false,
animationType: undefined,