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

31 lines
1.3 KiB
Diff

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,