Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari/iOS: hover background when unselecting a day #2064

Open
jasondainter opened this issue Mar 1, 2024 · 3 comments
Open

Safari/iOS: hover background when unselecting a day #2064

jasondainter opened this issue Mar 1, 2024 · 3 comments
Assignees
Labels
Bug Bug or Bug fixes

Comments

@jasondainter
Copy link

Description

When selecting the day of the month, then unselecting in a mobile browser (tested in chrome on IOS) it goes from

Selected...

IMG_4770

To Unselected (pressing the date again)

IMG_4769

But as you can see (this was tested via the demo on https://react-day-picker.js.org/start directly) you get this blue highlight remaining

Screenshot 2024-03-01 at 14 33 38

This is quite confusing UX as you would expect no selection at all (it looks like it is still selected when it isnt)

Seems fine on Desktop.

Is there any way to turn that off?

Expected Behavior

Expect the lighter blue circle to dissapear

Actual Behavior

Lighter blue circle remains after clearing selection.

Steps to Reproduce

  1. Step one - https://react-day-picker.js.org/start
  2. Step two - Press a date on mobile (ios/chrome)
  3. Step three - Unpress a date (unselect)

Your Environment

  • React version: 18.2.0
  • Browser [e.g. chrome, safari]: Chrome
  • Version [e.g. 22]: Chrome 122
  • Operating System [e.g. iOS, Windows]: iOS 17.3
@gpbl
Copy link
Owner

gpbl commented Mar 2, 2024

@jasondainter I see it. It looks like Safari is keeping the :hover style. It seems to be an issue for other people too: https://stackoverflow.com/questions/47802530.

Screenshot 2024-03-02 at 6 40 30 AM

@gpbl gpbl added the Bug Bug or Bug fixes label Mar 2, 2024
@gpbl gpbl changed the title On mobile, unselecting a date leaves a lighter blue selected circle remaining Safari/iOS: hover background when unselecting a day Mar 2, 2024
@gpbl
Copy link
Owner

gpbl commented Mar 3, 2024

Looks like the fix is to include the over style inside @media (hover: hover) {.

@jasondainter
Copy link
Author

Thanks for quick feedback. in the end I disabled the hover entirely. In my case todays date is highlighted (selected) when the user sees the calendar so I probably get away with this more (eg its more obvious the user has to click a date). would be great to have this fixed in a future version if doable!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug or Bug fixes
Projects
None yet
Development

No branches or pull requests

2 participants