Skip to content

Commit 0e58b89

Browse files
authored
Merge pull request #607 from hossein-zare/dev-5.x
v5.4.3
2 parents 1edf8cc + 3316830 commit 0e58b89

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-dropdown-picker",
3-
"version": "5.4.2",
3+
"version": "5.4.3",
44
"description": "A single / multiple, categorizable, customizable, localizable and searchable item picker (drop-down) component for react native which supports both Android & iOS.",
55
"keywords": [
66
"picker",

src/components/Picker.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ function Picker({
129129
activityIndicatorColor = Colors.GREY,
130130
props = {},
131131
itemProps = {},
132+
itemLabelProps = {},
132133
badgeProps= {},
133134
modalProps = {},
134135
flatListProps = {},
@@ -1263,7 +1264,7 @@ function Picker({
12631264

12641265
// Not a reliable method for external value changes.
12651266
if (multiple) {
1266-
if (memoryRef.current.value.includes(item[_schema.value])) {
1267+
if (memoryRef.current.value?.includes(item[_schema.value])) {
12671268
const index = memoryRef.current.items.findIndex(x => x[_schema.value] === item[_schema.value]);
12681269

12691270
if (index > -1) {
@@ -1279,7 +1280,7 @@ function Picker({
12791280

12801281
setValue(state => {
12811282
if (multiple) {
1282-
let _state = state !== null ? [...state] : [];
1283+
let _state = state !== null && state !== undefined ? [...state] : [];
12831284

12841285
if (_state.includes(item[_schema.value])) {
12851286
// Remove the value
@@ -1446,6 +1447,7 @@ function Picker({
14461447
disabled={item?.[_schema.disabled] ?? false}
14471448
custom={item.custom ?? false}
14481449
props={itemProps}
1450+
labelProps={itemLabelProps}
14491451
isSelected={isSelected}
14501452
IconComponent={IconComponent}
14511453
TickIconComponent={_TickIconComponent}
@@ -1492,6 +1494,7 @@ function Picker({
14921494
_value,
14931495
multiple,
14941496
itemProps,
1497+
itemLabelProps,
14951498
categorySelectable,
14961499
onPressItem,
14971500
theme,

src/components/RenderListItem.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function RenderListItem({
2020
selectable,
2121
disabled,
2222
props,
23+
labelProps,
2324
custom,
2425
isSelected,
2526
IconComponent,
@@ -164,7 +165,7 @@ function RenderListItem({
164165
return (
165166
<TouchableOpacity style={_listItemContainerStyle} onPress={__onPress} onLayout={onLayout} {...props} disabled={selectable === false || disabled} testID={item.testID}>
166167
{IconComponent}
167-
<Text style={_listItemLabelStyle}>
168+
<Text style={_listItemLabelStyle} {...labelProps}>
168169
{label}
169170
</Text>
170171
{_TickIconComponent}

0 commit comments

Comments
 (0)