Skip to content

Commit 4130e88

Browse files
authored
Merge pull request #5 from imdevan/670-jheigle-pr
2 parents 4660b8f + 43cc9d9 commit 4130e88

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ declare module 'react-native-dropdown-picker' {
197197
containerStyle?: StyleProp<ViewStyle>;
198198
customItemContainerStyle?: StyleProp<ViewStyle>;
199199
customItemLabelStyle?: StyleProp<TextStyle>;
200+
customItemValueDelimiter?: string;
200201
disableBorderRadius?: boolean;
201202
disabledItemContainerStyle?: StyleProp<ViewStyle>;
202203
disabledItemLabelStyle?: StyleProp<TextStyle>;

src/components/Picker.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ function Picker({
8383
containerStyle = {},
8484
customItemContainerStyle = {},
8585
customItemLabelStyle = {},
86+
customItemValueDelimiter = '-',
8687
disableBorderRadius = true,
8788
disabled = false,
8889
disabledItemContainerStyle = {},
@@ -541,7 +542,7 @@ function Picker({
541542
) {
542543
results.push({
543544
[ITEM_SCHEMA.label]: searchText,
544-
[ITEM_SCHEMA.value]: searchText.replace(' ', '-'),
545+
[ITEM_SCHEMA.value]: customItemValueDelimiter ? searchText.replaceAll(' ', customItemValueDelimiter) : searchText,
545546
custom: true,
546547
});
547548
}

0 commit comments

Comments
 (0)