Skip to content

Commit 36d9b33

Browse files
committed
Added scrollStyle prop
1 parent d35b131 commit 36d9b33

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ Change valueExtractor and pass the data to Autocomplete without fetchDataUrl
155155
listHeaderTextStyle | Styles for list header text | Object | -
156156
overlayStyle | Styles for overlay view | Object | -
157157
pickerStyle | Styles for item picker view | Object | -
158-
containerStyle | Styles for dropdown container view | Object | -
158+
containerStyle | Styles for dropdown container view | Object | -
159+
scrollStyle | Styles for dropdown flatlist | Object | -
159160
scrollToInput | Focus on selected field | Function | -
160161
handleSelectItem | Selection callback (agrs: item, index) | Function | -
161162
onDropdownShow | Show keyboard | Function | -

components/Dropdown/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ export default class Dropdown extends PureComponent {
454454
render() {
455455
const {
456456
containerStyle,
457+
scrollStyle,
457458
overlayStyle: overlayStyleOverrides,
458459
pickerStyle: pickerStyleOverrides,
459460
supportedOrientations,
@@ -497,7 +498,7 @@ export default class Dropdown extends PureComponent {
497498
keyboardShouldPersistTaps="always"
498499
ref={this.updateScrollRef}
499500
data={itemData}
500-
style={styles.scroll}
501+
style={[styles.scroll, scrollStyle]}
501502
renderItem={this.renderItem}
502503
keyExtractor={this.keyExtractor}
503504
scrollEnabled={visibleItemCount <= itemCount}

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ type AutocompleteProps = {
3030
overlayStyle?: StyleProp<TextStyle>;
3131
pickerStyle?: StyleProp<TextStyle>;
3232
containerStyle?: StyleProp<ViewStyle>;
33+
scrollStyle?: StyleProp<ViewStyle>;
3334

3435
scrollToInput: (ev: any) => void,
3536
handleSelectItem: (item: any, index: number) => void,

0 commit comments

Comments
 (0)