diff --git a/package.json b/package.json index f82181d..4d4e3ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-dropdown-picker", - "version": "5.4.2", + "version": "5.4.3", "description": "A single / multiple, categorizable, customizable, localizable and searchable item picker (drop-down) component for react native which supports both Android & iOS.", "keywords": [ "picker", diff --git a/src/components/Picker.js b/src/components/Picker.js index 9bbacc7..0b06940 100644 --- a/src/components/Picker.js +++ b/src/components/Picker.js @@ -129,6 +129,7 @@ function Picker({ activityIndicatorColor = Colors.GREY, props = {}, itemProps = {}, + itemLabelProps = {}, badgeProps= {}, modalProps = {}, flatListProps = {}, @@ -1263,7 +1264,7 @@ function Picker({ // Not a reliable method for external value changes. if (multiple) { - if (memoryRef.current.value.includes(item[_schema.value])) { + if (memoryRef.current.value?.includes(item[_schema.value])) { const index = memoryRef.current.items.findIndex(x => x[_schema.value] === item[_schema.value]); if (index > -1) { @@ -1279,7 +1280,7 @@ function Picker({ setValue(state => { if (multiple) { - let _state = state !== null ? [...state] : []; + let _state = state !== null && state !== undefined ? [...state] : []; if (_state.includes(item[_schema.value])) { // Remove the value @@ -1446,6 +1447,7 @@ function Picker({ disabled={item?.[_schema.disabled] ?? false} custom={item.custom ?? false} props={itemProps} + labelProps={itemLabelProps} isSelected={isSelected} IconComponent={IconComponent} TickIconComponent={_TickIconComponent} @@ -1492,6 +1494,7 @@ function Picker({ _value, multiple, itemProps, + itemLabelProps, categorySelectable, onPressItem, theme, diff --git a/src/components/RenderListItem.js b/src/components/RenderListItem.js index 401f5d6..110a300 100644 --- a/src/components/RenderListItem.js +++ b/src/components/RenderListItem.js @@ -20,6 +20,7 @@ function RenderListItem({ selectable, disabled, props, + labelProps, custom, isSelected, IconComponent, @@ -164,7 +165,7 @@ function RenderListItem({ return ( {IconComponent} - + {label} {_TickIconComponent}