question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Calendar does not react to a change of value if lands in prev/next month

See original GitHub issue

🐛 Bug Report

When programmatically changing the value for DatePicker (or DateRangePicker), if the day/range lands in the previous month, the UI does not show the correct selected month.

🤔 Expected Behavior

The UI should update to show the picked day/range when value updates.

😯 Current Behavior

Month does not switch. See Codesandbox example

🔦 Context

We need the UI to update correctly. While the DatePicker assumes that the popover will be closed when choosing a new value, this is not true for our use case.

💻 Code Sample

See Codesandbox example

🌍 Your Environment

Software Version(s)
react-spectrum 3.20.0
Browser Chrome 104.0.5112.79
Operating System OSX Monterey

🧢 Your Company/Team

Mastery Logistics Systems

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
LFDanLucommented, Aug 24, 2022

We can take a look at supporting this in DatePicker but if you are using the aria hooks to create your own DatePicker you can try using the focusedValue prop in useCalendar fix this behavior.

1reaction
snowystingercommented, Aug 16, 2022

Thanks for the extra context! That isn’t something that spectrum currently defines. So it may be that you need to implement some extra things as a result/you may find other cases we don’t support. Still odd our calendar doesn’t update, that seems like a bug at least. I’ll bring it up to our team.

Read more comments on GitHub >

github_iconTop Results From Across the Web

calendar don't update view when value change to other month
When I change value of date in current month calendar update view. But when value in new month, calendar still show current month....
Read more >
React-calendar Ui not switching when value is set from ...
The UI of the react calendar is not switching to the respective month when the value is set functionally after the calendar has...
Read more >
Flexipass | City of Vancouver
A Flexipass gives you access to fitness centres, indoor pools, and ice rinks throughout the city. You can purchase your monthly Flexipass for...
Read more >
Untitled
The Greg Gutfeld Show does not have an online form because the studio is very small. Greg Gutfeld Concert Schedule Nov 19, 2022...
Read more >
Calendar.PrevMonthText Property - Microsoft Learn
This property does not automatically encode to HTML. You need to convert special characters to the appropriate HTML value, unless you want the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found