File tree Expand file tree Collapse file tree 5 files changed +6
-1
lines changed Expand file tree Collapse file tree 5 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,7 @@ yarn android
285
285
| ` direction ` | "up" or "down" | string | down + auto calculate |
286
286
| ` matchFrom ` | Whether match suggestions from start of titles or anywhere in the title. Possible values are "any" or "start" | string | any |
287
287
| ` bottomOffset ` | For calculate dropdown direction (e.g., tabbar) | number | 0 |
288
+ | ` theme ` | Color scheme. Possible values are "light" or "dark" | string | OS's color scheme |
288
289
| ` onChangeText ` | Event textInput onChangeText | function | |
289
290
| ` onSelectItem ` | Event onSelectItem | function | |
290
291
| ` onOpenSuggestionsList ` | Event onOpenSuggestionsList | function | |
Original file line number Diff line number Diff line change @@ -239,6 +239,7 @@ npm run ios
239
239
| ` direction ` | "up" or "down" | string | down + auto calculate |
240
240
| ` position ` | "relative" or "absolute" | string | relative |
241
241
| ` bottomOffset ` | for calculate dropdown direction (e.g. tabbar) | number | 0 |
242
+ | ` theme ` | Color scheme. Possible values are "light" or "dark" | string | OS's color scheme |
242
243
| ` onChangeText ` | event textInput onChangeText | function | |
243
244
| ` onSelectItem ` | event onSelectItem | function | |
244
245
| ` onOpenSuggestionsList ` | event onOpenSuggestionsList | function | |
Original file line number Diff line number Diff line change @@ -277,6 +277,7 @@ yarn ios
277
277
| ` direction ` | "up" or "down" | string | down + auto calculate |
278
278
| ` matchFrom ` | whether match suggestions from start of titles or anywhere in the title. Possible values are "any" or "start" | string | any |
279
279
| ` bottomOffset ` | for calculate dropdown direction (e.g. tabbar) | number | 0 |
280
+ | ` theme ` | Color scheme. Possible values are "light" or "dark" | string | OS's color scheme |
280
281
| ` onChangeText ` | event textInput onChangeText | function | |
281
282
| ` onSelectItem ` | event onSelectItem | function | |
282
283
| ` onOpenSuggestionsList ` | event onOpenSuggestionsList | function | |
Original file line number Diff line number Diff line change @@ -18,9 +18,10 @@ export const Dropdown = memo((props: DropdownProps) => {
18
18
ListEmptyComponent,
19
19
ItemSeparatorComponent,
20
20
direction,
21
+ theme,
21
22
...rest
22
23
} = props
23
- const themeName = useColorScheme ( )
24
+ const themeName = theme || useColorScheme ( )
24
25
const styles = useMemo ( ( ) => getStyles ( themeName || 'light' ) , [ themeName ] )
25
26
26
27
const defaultItemSeparator = useMemo ( ( ) => {
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ export interface IAutocompleteDropdownProps {
46
46
position ?: 'absolute' | 'relative'
47
47
bottomOffset ?: number
48
48
textInputProps ?: TextInputProps
49
+ theme ?: 'light' | 'dark'
49
50
onChangeText ?: ( text : string ) => void
50
51
onSelectItem ?: ( item : AutocompleteDropdownItem | null ) => void
51
52
renderItem ?: ( item : AutocompleteDropdownItem , searchText : string ) => React . ReactElement | null
You can’t perform that action at this time.
0 commit comments