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.

Focus/Selectable state on DayPicker?

See original GitHub issue

Hello,

I was wondering if there was a way to have a selectable/focusable state when the user clicks on a date in the <DayPicker /> component?

For example, the <DateRangePicker /> component has a focus prop, but it doesn’t seem like it’s possible with the <DayPicker />.

Thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
chellbergcommented, Oct 19, 2016

In case it helps anyone, I found a slightly simpler (possibly inferior) workaround for disabling days on the DayPicker:

<DayPicker
  modifiers={{
    past: day => day.isBefore(moment()),
  }}
/>
td.CalendarMonth__day--past {
  pointer-events: none;
}

source

0reactions
webdevfranciscocommented, Jun 26, 2020

A quick modification to @chellberg to make the non-selectable days apparent and allow the current day to be selected

past: day => day.isBefore( moment().subtract(1, 'day') )
td.CalendarMonth__day--past {
  pointer-events: none;
  opacity: .2;
}

this no longer works, I’m on version ^21.8.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Focus/Selectable state on DayPicker? · Issue #82 - GitHub
Hello, I was wondering if there was a way to have a selectable/focusable state when the user clicks on a date in the...
Read more >
Date Picker Component | React DayPicker
React DayPicker is a date picker component for React. Renders a calendar where the user can browse months to select days. DayPicker is...
Read more >
Datepicker - Angular powered Bootstrap
A highly configurable component that helps you with selecting calendar dates. NgbDatepicker is meant to be displayed inline on a page or put...
Read more >
React Day Picker only changing "to" state on second click
I checked your code. It looks like it receives proper value in the state for both the two value To and From.
Read more >
DatePicker | Apple Developer Documentation
The following example shows a date-and-time picker that only permits selections within the year 2021 (in the UTC time zone). @State private var...
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