Skip to content

Commit

Permalink
feat: add option to prevent virtual keyboard from opening (#2376)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-hv authored Dec 20, 2023
1 parent cf82b39 commit 4f0a74c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/DatePicker/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface DatePickerOptions {
onFocus?: CustomInputOptions['handleFocus']
useWeekdaysShort?: boolean
placeholder?: ReactDatePickerProps['placeholderText']
preventVirtualKeyboard?: boolean
value: string | Date
transparent?: boolean
}
Expand Down Expand Up @@ -49,6 +50,7 @@ export const DatePicker = forwardRef<'input', DatePickerProps>(
onChange,
onFocus,
placeholder,
preventVirtualKeyboard = false,
popperProps,
size = 'md',
startYear = 1900,
Expand Down Expand Up @@ -135,6 +137,7 @@ export const DatePicker = forwardRef<'input', DatePickerProps>(
handleFocus={e => handleFocus(e)}
icon={icon}
iconPlacement={iconPlacement}
inputMode={preventVirtualKeyboard ? 'none' : 'text'}
onReset={handleReset}
ref={instance => {
// for internal use only
Expand Down

0 comments on commit 4f0a74c

Please sign in to comment.