Skip to content

Commit

Permalink
Merge pull request #331 from VanillaViking/master
Browse files Browse the repository at this point in the history
Default input type for time picker
  • Loading branch information
iM-GeeKy authored Sep 13, 2023
2 parents 9063fea + b173506 commit d62a2e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docusaurus/docs/time-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,7 @@ Flag indicating if the time input should use the 24 hours clock. Defaults to the
**inputFontSize**
`Type: number | undefined`
Font size of the time input. Defaults to 57. Useful when using a custom font.

**defaultInputType**
`Type: 'picker' | 'keyboard'`
Which input type to use by default. Defaults to the clock-face picker.
4 changes: 3 additions & 1 deletion src/Time/TimePickerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export function TimePickerModal({
clockIcon = 'clock-outline',
use24HourClock,
inputFontSize,
defaultInputType,
}: {
locale?: undefined | string
label?: string
Expand All @@ -73,6 +74,7 @@ export function TimePickerModal({
clockIcon?: string
use24HourClock?: boolean
inputFontSize?: number
defaultInputType?: PossibleInputTypes
}) {
const theme = useTheme()

Expand All @@ -86,7 +88,7 @@ export function TimePickerModal({
}

const [inputType, setInputType] = React.useState<PossibleInputTypes>(
inputTypes.picker
defaultInputType || inputTypes.picker
)
const [focused, setFocused] = React.useState<PossibleClockTypes>(
clockTypes.hours
Expand Down

0 comments on commit d62a2e0

Please sign in to comment.