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

[Tooltip] Improve handling of small vs. touch screens #26097

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented May 2, 2021

Closes #23363

I gave a second look at the issue. Since my last proposal #23363, I have changed a bit my hypothesis and conclusion. At first, I thought that using the screen width to change the density of the tooltip would make the most sense, but I realized that with responsive font sizes, we do the opposite, we reduce the font size, we don't increase it. Also, these density visual changes seem to contribute to increasing the gap, which uses styleProps.touch too.

@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: tooltip This is the name of the generic UI component, not the React module! labels May 2, 2021
@mui-pr-bot
Copy link

mui-pr-bot commented May 2, 2021

Details of bundle changes (experimental)

Generated by 🚫 dangerJS against ba13a9c

@oliviertassinari oliviertassinari force-pushed the tooltip-better-isolate-touch-vs-screen-sze branch from 53f895a to b1a609f Compare May 2, 2021 17:13
Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the opposite of what we should do. We should rely on CSS not JS

packages/material-ui/src/Tooltip/Tooltip.js Outdated Show resolved Hide resolved
@oliviertassinari
Copy link
Member Author

oliviertassinari commented May 11, 2021

At the UX level. What's the expected behavior? As far as I understand, we have the following constraints to satisfy:

  1. There are two variant styles, one for mouse (no matter the screen width) and one for touch interactions.
  2. touch interactions can be triggered even if the primary pointing device is a mouse, e.g. Windows surface.
  3. touch interactions can be displayed on large screens, e.g. Windows surface.

We should rely on CSS not JS

Yes CSS > JS, but does it mean that CSS-only would work here? I couldn't find a CSS solution that satisfies the above. If there is one, then great, let's use it.

Note that it's not the problem I'm going after (CSS over JS). This could be done as a follow-up as we already depend on it. The problem I'm going after is to satisfies the above 3 UI/UX constraints.

@oliviertassinari oliviertassinari changed the title [Tooltip] Fix handling of small vs. touch screens [Tooltip] Improve handling of small vs. touch screens May 18, 2021
@oliviertassinari oliviertassinari merged commit 07be194 into mui:next May 18, 2021
@oliviertassinari oliviertassinari deleted the tooltip-better-isolate-touch-vs-screen-sze branch May 18, 2021 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: tooltip This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tooltip] The default offset of popper changes for different screen sizes.
3 participants