You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am implementing DateRangePicker using useRangeCalendar hook. I have two double-arrow buttons , which should control the current focused year. Upon clicking the buttons, i am calling state.focusPreviousSection(true), which works almost correctly. I expect it to always just change the year but sometimes (see video) it changes the focused month by one back/forward.
My other settings:
const state = useRangeCalendarState({
...props,
locale: locale,
createCalendar: createCalendar,
firstDayOfWeek: "mon",
visibleDuration: { months: 2 },
pageBehavior: "single", // When clicking prev/next month buttons, the calendar will move by 1 month
})
const state = useRangeCalendarState({
...props,
locale: locale,
createCalendar: createCalendar,
firstDayOfWeek: "mon",
visibleDuration: { months: 2 },
pageBehavior: "single", // When clicking prev/next month buttons, the calendar will move by 1 month
})
and call state.focusPreviousSection(true) or state.focusNextSection(true)
(i tried to change the year also with state.setFocusedDate(state.focusedDate.add({ years: -1 })) with same results).
Version
react-aria: "3.37.0"
What browsers are you seeing the problem on?
Firefox
If other, please specify.
No response
What operating system are you using?
MacOS 14.4.1 (23E224)
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered:
jdolinski1
changed the title
Focusing Next/Previous year with two visible durations jumps one month back/forward
DateRangePicker: Focusing Next/Previous year with two visible durations jumps one month back/forward
Jan 21, 2025
snowystinger
changed the title
DateRangePicker: Focusing Next/Previous year with two visible durations jumps one month back/forward
DateRangePicker: Focusing Next/Previous year with visibleDuration 2 jumps one month back/forward
Jan 21, 2025
Provide a general summary of the issue here
I am implementing DateRangePicker using
useRangeCalendar
hook. I have two double-arrow buttons , which should control the current focused year. Upon clicking the buttons, i am callingstate.focusPreviousSection(true)
, which works almost correctly. I expect it to always just change the year but sometimes (see video) it changes the focused month by one back/forward.My other settings:
Functions called when clicking arrow buttons.
Buttons for focusing the next/previous month/year
Video:
Screen.Recording.2025-01-21.at.11.55.36.mov
🤔 Expected Behavior?
I expect to just change the year and not focused month.
😯 Current Behavior
Sometimes it changes also focused month.
💁 Possible Solution
There might be some bug in this settings combination:
🔦 Context
No response
🖥️ Steps to Reproduce
Use
useRangeCalendarState
with this properties:and call
state.focusPreviousSection(true)
orstate.focusNextSection(true)
(i tried to change the year also with
state.setFocusedDate(state.focusedDate.add({ years: -1 }))
with same results).Version
react-aria: "3.37.0"
What browsers are you seeing the problem on?
Firefox
If other, please specify.
No response
What operating system are you using?
MacOS 14.4.1 (23E224)
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: