Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to set active item text style #269

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ yarn add react-native-element-dropdown
| itemContainerStyle | TextStyle | No | Styling for item container in list |
| itemTextStyle | TextStyle | No | Styling for text item in list |
| activeColor | String | No | Background color for item selected in list container |
| activeItemTextStyle | TextStyle | No | Text style for item selected in list container |
| search | Boolean | No | Show or hide input search |
| searchQuery | (keyword: string, labelValue: string) => Boolean| No | Callback used to filter the list of items |
| inputSearchStyle | ViewStyle | No | Styling for input search |
Expand Down Expand Up @@ -113,6 +114,7 @@ yarn add react-native-element-dropdown
| iconStyle | ImageStyle | No | Styling for icon |
| iconColor | String | No | Color of icons |
| activeColor | String | No | Background color for item selected in list container |
| activeItemTextStyle | TextStyle | No | Text style for item selected in list container |
| itemContainerStyle | TextStyle | No | Styling for item container in list |
| itemTextStyle | TextStyle | No | Styling for text item in list |
| selectedStyle | ViewStyle | No | Styling for selected view |
Expand Down
3 changes: 3 additions & 0 deletions src/components/Dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const DropdownComponent: <T>(
searchField,
value,
activeColor = '#F6F7F8',
activeItemTextStyle,
fontFamily,
iconColor = 'gray',
searchPlaceholder,
Expand Down Expand Up @@ -486,6 +487,7 @@ const DropdownComponent: <T>(
style={StyleSheet.flatten([
styles.textItem,
itemTextStyle,
selected && activeItemTextStyle,
font(),
])}
>
Expand All @@ -500,6 +502,7 @@ const DropdownComponent: <T>(
[
accessibilityLabel,
activeColor,
activeItemTextStyle,
currentValue,
font,
itemAccessibilityLabelField,
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 @@ -34,6 +34,7 @@ export interface DropdownProps<T> {
fontFamily?: string;
iconColor?: string;
activeColor?: string;
activeItemTextStyle?: StyleProp<TextStyle>;
data: T[];
value?: T | string | null | undefined;
placeholder?: string;
Expand Down
3 changes: 3 additions & 0 deletions src/components/MultiSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const MultiSelectComponent: <T>(
itemTextStyle,
iconStyle,
activeColor = '#F6F7F8',
activeItemTextStyle,
containerStyle,
fontFamily,
placeholderStyle,
Expand Down Expand Up @@ -479,6 +480,7 @@ const MultiSelectComponent: <T>(
style={StyleSheet.flatten([
styles.textItem,
itemTextStyle,
selected && activeItemTextStyle,
font(),
])}
>
Expand All @@ -493,6 +495,7 @@ const MultiSelectComponent: <T>(
[
accessibilityLabel,
activeColor,
activeItemTextStyle,
checkSelected,
font,
itemAccessibilityLabelField,
Expand Down
1 change: 1 addition & 0 deletions src/components/MultiSelect/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export interface MultiSelectProps<T> {
fontFamily?: string;
iconColor?: string;
activeColor?: string;
activeItemTextStyle?: StyleProp<TextStyle>;
data: T[];
value?: string[] | null | undefined;
placeholder?: string;
Expand Down