Skip to content

Commit

Permalink
fix(input-date): allow to use left arrow in day and right arrow in year
Browse files Browse the repository at this point in the history
  • Loading branch information
clementprevot committed Aug 23, 2023
1 parent 2654b26 commit c8df171
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/fractal/src/components/InputDate/InputDate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,39 +269,41 @@ export const InputDate = forwardRef<CombinedRefs, InputDateProps>(
case 'month':
if (dayRef.current) {
dayRef.current.focus()
event.preventDefault()
}
break

case 'year':
if (monthRef.current) {
monthRef.current.focus()
event.preventDefault()
}
break

default:
break
}
event.preventDefault()
break

case 'ArrowRight':
switch (type) {
case 'day':
if (monthRef.current) {
monthRef.current.focus()
event.preventDefault()
}
break

case 'month':
if (yearRef.current) {
yearRef.current.focus()
event.preventDefault()
}
break

default:
break
}
event.preventDefault()
break

case 'ArrowUp':
Expand Down

0 comments on commit c8df171

Please sign in to comment.