saadeghi / daisyui

๐ŸŒผ ๐ŸŒผ ๐ŸŒผ ๐ŸŒผ ๐ŸŒผ โ€ƒThe most popular, free and open-source Tailwind CSS component library
https://daisyui.com
MIT License
33.05k stars 1.26k forks source link

v3: about the disabling of hover effects on mobile #1886

Closed gurgunday closed 1 year ago

gurgunday commented 1 year ago

What version of daisyUI are you using?

v3.0

Describe your issue

I understand the motivation behind this change, but honestly this just broke all interaction animations (including button presses) on mobile. Can't this be a config option instead of being the default? Even if this change stays, I think button press animations should not be disabled in any case.

What browsers are you seeing the problem on?

No response

Reproduction URL (optional)

https://heyhey.to/HEYHEY On mobile, buttons simply don't respond to any gesture.

saadeghi commented 1 year ago

There is really no reason to allow :hover on a device that does not support hover because on a touch device there is no cursor to move over elements and leave the element. It's just taps. and if we tap an element with :hover the hover effect stays unless we tap another element. It's not a hover behavior at all. It's broken!

Also, probably this will be the default behavior on the next Tailwind CSS release as well: https://twitter.com/adamwathan/status/1664049901322264577

gurgunday commented 1 year ago

Okay, I understand why the hover effects were removed, but on iOS, button "presses" don't have any animation either.

Here's an example that demonstrates the change.

Before (v2): https://github.com/saadeghi/daisyui/assets/74139498/dc8f5cb8-0456-413c-901b-0be4ffbf55b3

After (v3): https://github.com/saadeghi/daisyui/assets/74139498/09127de5-11de-43a4-803c-51ec2b9127d6

Notice how on v2 buttons react to being pressed on - they no longer do on v3. I think this part of the change was unintentional?

gurgunday commented 1 year ago

@saadeghi sorry for the tag, I just need confirmation that the removal of button press animations on iOS is intentional as well so that I don't create another issue ๐Ÿ˜

You can check the above videos to see the change I'm talking about. Thanks for the update again, it's great overall!

saadeghi commented 1 year ago

@gurgunday The color change of buttons on hover is removed for touch devices and is not coming back (because touch devices keep the element on hover style for ever until you tap somewhere else)

But I see that the click animation (button getting smaller while it is pressed) is also disabled as a side effect. (because that style is also using hover as well)

I'm working on it...

saadeghi commented 1 year ago

@gurgunday Should be fixed now on 3.0.2

gurgunday commented 1 year ago

@saadeghi hey, thanks for the quick update! I tested the change but I still see no click animation.

Here's the most recent version (3.0.2):

https://github.com/saadeghi/daisyui/assets/74139498/c43de0fa-9ab7-4889-a24e-c01f8f12f833

The URL: https://heyhey.to/G