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

add animationType to DatePickerInput #338

Merged
merged 2 commits into from
Sep 18, 2023
Merged
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
4 changes: 4 additions & 0 deletions docusaurus/docs/date-picker/input-date-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ Determines the visual presentation style of the date picker modal. This prop all
- `'formSheet'`: Renders the modal as a smaller form-style sheet.
- `'overFullScreen'`: Overlays the modal on top of the content, allowing interaction with the underlying content.

**animationType**
`Type: 'slide' | 'fade' | 'none' | undefined`
The animation used when opening the date picker modal. Defaults to `'slide'`.

For example, if you set `presentationStyle` to `'pageSheet'`, the modal will be presented as a card-like sheet.

- Other [react-native TextInput props](https://reactnative.dev/docs/textinput#props).\*
1 change: 1 addition & 0 deletions src/Date/DatePickerInput.shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type DatePickerInputProps = {
onChangeText?: (text: string | undefined) => void
inputEnabled?: boolean
disableStatusBarPadding?: boolean
animationType?: 'slide' | 'fade' | 'none'
} & Omit<
React.ComponentProps<typeof TextInput>,
'value' | 'onChange' | 'onChangeText' | 'inputMode'
Expand Down
2 changes: 2 additions & 0 deletions src/Date/DatePickerInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function DatePickerInput(
{
withModal = true,
calendarIcon = 'calendar',
animationType = 'slide',
...rest
}: DatePickerInputProps,
ref: any
Expand Down Expand Up @@ -76,6 +77,7 @@ function DatePickerInput(
endYear={endYear ?? 2200}
inputEnabled={inputEnabled}
disableStatusBarPadding={disableStatusBarPadding ?? false}
animationType={animationType}
/>
) : null
}
Expand Down