Skip to content

Commit cb23031

Browse files
committed
Add keyboardType option #16
1 parent c0a0696 commit cb23031

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ Change valueExtractor and pass the data to Autocomplete without fetchDataUrl
131131
name | description | type | default
132132
:----------------- |:--------------------------------------------- | --------:|:------------------
133133
autoCorrect | Disable auto-correct | Boolean | true
134+
keyboardType | Input Keyboard Type | String | default
134135
highlightText | Highlight search results | Boolean | true
135136
highLightColor | Highlight text color | String | #129a8d
136137
rightContent | Render additional text to the right of the item | Boolean | false

components/Autocomplete/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ class Autocomplete extends Component {
158158
spinnerSize,
159159
listHeader,
160160
autoCorrect,
161+
keyboardType,
161162
spinnerColor,
162163
placeholderColor,
163164
data,
@@ -178,6 +179,7 @@ class Autocomplete extends Component {
178179
placeholderTextColor={placeholderColor || theme.textSecondary}
179180
value={inputValue}
180181
autoCorrect={autoCorrect}
182+
keyboardType={keyboardType}
181183
onChangeText={text => this.handleInputChange(text)}
182184
onFocus={event => {
183185
scrollToInput(findNodeHandle(event.target));
@@ -213,6 +215,7 @@ Autocomplete.defaultProps = {
213215
placeholder: locales.components.Autocomplete.placeholder,
214216
spinnerSize: "small",
215217
autoCorrect: false,
218+
keyboardType: "default",
216219
minimumCharactersCount: 2,
217220
highlightText: true,
218221
waitInterval: WAIT_INTERVAL,
@@ -230,6 +233,7 @@ Autocomplete.propTypes = {
230233
highlightText: bool,
231234
rightContent: bool,
232235
autoCorrect: bool,
236+
keyboardType: string,
233237
resetOnSelect: bool,
234238

235239
valueExtractor: func,

index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
// Type definitions for react-native-dropdown-autocomplete 1.0
22

33
import * as React from 'react';
4-
import { ViewStyle, TextStyle, StyleProp } from 'react-native';
4+
import { ViewStyle, TextStyle, StyleProp, KeyboardTypeOptions } from 'react-native';
55

66
type AutocompleteProps = {
77
autoCorrect?: boolean,
8+
keyboardType?: KeyboardTypeOptions;
89
highlightText?: boolean,
910
highLightColor?: string,
1011
rightContent?: boolean,

0 commit comments

Comments
 (0)