Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ yarn add react-native-element-dropdown
| value | Item | No | Set default value |
| placeholder | String | No | The string that will be rendered before dropdown has been selected |
| placeholderStyle | TextStyle | No | Styling for text placeholder |
| selectedTextStyle | TextStyle | No | Styling for selected text |
| selectedText | TextStyle | No | Styling for selected text |
| selectedTextStyle | TextStyle | No | Custom selected text |
| selectedTextProps | TextProps | No | Text Props for selected text. Ex: numberOfLines={1} |
| style | ViewStyle | No | Styling for view container |
| containerStyle | ViewStyle | No | Styling for list container |
Expand Down
3 changes: 2 additions & 1 deletion src/components/Dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const DropdownComponent = React.forwardRef<IDropdownRef, DropdownProps<any>>(
style = {},
containerStyle,
placeholderStyle,
selectedText,
selectedTextStyle,
itemContainerStyle,
itemTextStyle,
Expand Down Expand Up @@ -460,7 +461,7 @@ const DropdownComponent = React.forwardRef<IDropdownRef, DropdownProps<any>>(
{...selectedTextProps}
>
{isSelected !== null
? _get(currentValue, labelField)
? (selectedText ? selectedText : _get(currentValue, labelField))
: placeholder}
</Text>
{renderRightIcon ? (
Expand Down
1 change: 1 addition & 0 deletions src/components/Dropdown/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface DropdownProps<T> {
style?: StyleProp<ViewStyle>;
containerStyle?: StyleProp<ViewStyle>;
placeholderStyle?: StyleProp<TextStyle>;
selectedText?: string;
selectedTextStyle?: StyleProp<TextStyle>;
selectedTextProps?: TextProps;
itemContainerStyle?: StyleProp<ViewStyle>;
Expand Down