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

Ability to change keyboard type during search #230

Open
wants to merge 3 commits 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
3 changes: 3 additions & 0 deletions src/components/Dropdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const DropdownComponent: <T>(
accessibilityLabel,
itemAccessibilityLabelField,
mode = 'default',
keyboardType
} = props;

const ref = useRef<View>(null);
Expand Down Expand Up @@ -490,6 +491,7 @@ const DropdownComponent: <T>(
}}
placeholderTextColor="gray"
iconStyle={[{ tintColor: iconColor }, iconStyle]}
keyboardType={keyboardType}
/>
);
}
Expand All @@ -508,6 +510,7 @@ const DropdownComponent: <T>(
searchPlaceholder,
testID,
searchText,
keyboardType
]);

const _renderList = useCallback(
Expand Down
2 changes: 2 additions & 0 deletions src/components/Dropdown/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type {
TextProps,
ImageStyle,
FlatListProps,
KeyboardType
} from 'react-native';

export type IDropdownRef = {
Expand Down Expand Up @@ -66,4 +67,5 @@ export interface DropdownProps<T> {
searchQuery?: (keyword: string, labelValue: string) => boolean;
onChangeText?: (search: string) => void;
onConfirmSelectItem?: (item: T) => void;
keyboardType?: KeyboardType;
}
2 changes: 2 additions & 0 deletions src/components/TextInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const TextInputComponent: CTextInput = (props) => {
onChangeText = (_value: string) => {},
renderLeftIcon,
renderRightIcon,
keyboardType
} = props;

const [text, setText] = useState<string>('');
Expand Down Expand Up @@ -91,6 +92,7 @@ const TextInputComponent: CTextInput = (props) => {
placeholder={placeholder}
placeholderTextColor={placeholderTextColor}
onChangeText={onChange}
keyboardType={keyboardType}
/>
{_renderRightIcon()}
</View>
Expand Down