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

[base-ui][joy-ui] Hover styles persist after clicking on an element on mobile #36583

Open
2 tasks done
oliviertassinari opened this issue Mar 20, 2023 · 9 comments
Open
2 tasks done
Labels
bug 🐛 Something doesn't work design This is about UI or UX design, please involve a designer package: base-ui Specific to @mui/base package: joy-ui Specific to @mui/joy

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Mar 20, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example:

Steps:

  1. Open https://mui.com/joy-ui/react-button/
  2. Click on an element that has a &:hover style

Current behavior 😯

KO, Joy UI

Screen.Recording.2023-03-20.at.11.46.17.mov

KO, Base UI

Screen.Recording.2023-03-20.at.11.39.12.mov

Expected behavior 🤔

OK on Material UI, however there is a limit, it's broken on all Samsung phones: #15000 (comment)

Screen.Recording.2023-03-20.at.11.39.46.mov

Context 🔦

#15000

Your environment 🌎

MUI Core v5.11.13

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work package: base-ui Specific to @mui/base package: joy-ui Specific to @mui/joy design: ux labels Mar 20, 2023
@oliviertassinari
Copy link
Member Author

oliviertassinari commented Mar 20, 2023

@danilo-leal @siriwatknp does this expected UX makes sense?

It's based on how native apps behave. On the web, it's very common for websites to leave an artifact hover style after an interaction, my thought was that native apps usually set the tone for what a great UX is, so I thought that we should probably copy it.

If yes, I think that it's something we can/should delegate to the community, waiting for someone to care enough to spend time on it.

@danilo-leal
Copy link
Contributor

I'm not 100% sure if you're asking if there should be a hover state on mobile but that's what I'm understanding 😬 Well, I guess hover technically "doesn't exist" on mobile as you can't just hover something, you either touch something or not. However, just quickly checked 3 very high-quality apps here, all native as far as I know, and they all react to a long-press interaction, which is sort of, to me, in between the hover and active states. So, in the end, yeah, they should probably react somehow and not be purely static.

Airbnb

airbnb.mp4

GitHub

github.mp4

Uber

uber.mp4

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Mar 21, 2023

@danilo-leal Right, to be clear, my concern is with the UI state that persists after the interaction. I have to touch on a dead area to find the normal UI state. All your recordings seems to (it's hard to see where the touch happen) behave as I would expect, categorized under "OK".

@danilo-leal
Copy link
Contributor

Ah, I see. Agree with you ⎯ it looks correct to me not to persist the state post-touch, which would be equivalent to not persisting the state post-click. In other words, the hover/active-like style difference would be triggered while you're actively touching and be gone the moment you lift the touch interaction up. 👍

@gitstart
Copy link
Contributor

@oliviertassinari I would like to pick this up

@oliviertassinari
Copy link
Member Author

I'm reopening, the issue is still present on Base UI: https://mui.com/base/react-button/

@gitstart
Copy link
Contributor

@oliviertassinari I'll be pushing a fix for this shortly. Sorry for not catching this.

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Jun 1, 2023

@gitstart no problems.

Note that it's not specific to the button, this bug can be reproduced on many other pages of the docs. The first page I tried reproduced the bug: https://mui.com/joy-ui/react-checkbox/.

@michaldudak michaldudak changed the title [base][joy] hover media query issue on mobile [base-ui][joy-ui] Hover styles persist after clicking on an element on mobile Aug 18, 2023
@oliviertassinari oliviertassinari added design This is about UI or UX design, please involve a designer and removed design: ux labels Aug 18, 2023
@oliviertassinari
Copy link
Member Author

oliviertassinari commented Sep 24, 2023

More context on the issue, faced in MUI X too mui/mui-x#10039. It seems that we can use GitHub tradeoffs for Base UI, Joy UI, Material UI: mui/mui-x#10039 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work design This is about UI or UX design, please involve a designer package: base-ui Specific to @mui/base package: joy-ui Specific to @mui/joy
Projects
None yet
Development

No branches or pull requests

3 participants