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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pickers] Popper touch the edge #10009

Open
oliviertassinari opened this issue Aug 11, 2023 · 7 comments
Open

[pickers] Popper touch the edge #10009

oliviertassinari opened this issue Aug 11, 2023 · 7 comments
Labels
bug 馃悰 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 11, 2023

Steps to reproduce 馃暪

Link to live example:

Steps:

  1. Open https://codesandbox.io/s/falling-bush-pdrn2j?file=/demo.tsx

Current behavior 馃槸

The PickersPopper open on the very edge.

Expected behavior 馃

Leave a space with the edge

Context 馃敠

I first observed this at https://flights.teamout.com/

Screenshot 2023-06-17 at 21 00 40

would it feel much better with some padding?

Screenshot 2023-08-11 at 22 48 25

cc @lildesert

Your environment 馃寧

v6.11.1

Order ID or Support key 馃挸 (optional)

No response

@oliviertassinari oliviertassinari added bug 馃悰 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! labels Aug 11, 2023
@oliviertassinari oliviertassinari changed the title [pikcer [pickers] Popper touch the edge Aug 11, 2023
@oliviertassinari
Copy link
Member Author

I think we depends on a fix in Base UI: mui/base-ui#39.

@LukasTy
Copy link
Member

LukasTy commented Aug 14, 2023

I've looked into this case and it seems that having a popper modifier is quite a tricky way to achieve such behavior.
What do you think about simply adding a horizontal margin to the popper Paper instead? 馃
Could be tested by adding the follow snippet to your demo.

slotProps={{
  desktopPaper: {
    sx: {
      mx: 1
    }
  }
}}

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Aug 14, 2023

What do you think about simply adding a horizontal margin to the popper Paper instead? 馃

This also shifts the anchor point no?
I tried this with the Material UI Tooltip mui/base-ui#413, doesn't work.

@LukasTy
Copy link
Member

LukasTy commented Aug 14, 2023

This also shifts the anchor point no?

Doesn't seem to shift it in the pickers case. 馃

Screen.Recording.2023-08-14.at.15.33.30.mov

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Aug 14, 2023

You would need to test with a placement like bottom-start, it won't be seen when centered.

For example, here we see it's 2px off https://mui.com/material-ui/react-tooltip/#positioned-tooltips

Screenshot 2023-08-14 at 14 38 25

@LukasTy
Copy link
Member

LukasTy commented Aug 14, 2023

Thanks for pointing it out.
Indeed, it's not a problem only when center placement is used.
In any case, wouldn't we expect that if this is implemented via @mui/base then it would have our preferred default (probably 8px) and would implicitly resolve this issue at the same time? 馃

@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 14, 2023

In any case, wouldn't we expect that if this is implemented via @mui/base then it would have our preferred default (probably 8px) and would implicitly resolve this issue at the same time? 馃

@LukasTy Oh, yeah, we could do this. It would fix this issue at the same time. But it depends on what default value we go with. If it's 4px to cover the tooltip use case, it won't be enough.

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: pickers This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer
Projects
None yet
Development

No branches or pull requests

2 participants