Skip to content

[Tooltip] Not being placed correctly when used with FormControlLabel checkbox because of default margin-left style #38012

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

Open
2 tasks done
OmPr366 opened this issue Jul 17, 2023 · 11 comments
Labels
bug 🐛 Something doesn't work component: FormControl The React component component: tooltip This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material

Comments

@OmPr366
Copy link
Contributor

OmPr366 commented Jul 17, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example: https://stackblitz.com/edit/react-qqwxar-c3zrv8?file=demo.tsx

Steps:

  1. Pass bottom-end to placement in tooltip
  2. Pass bottom-start to placement in tooltip
  3. compare both

Current behavior 😯

After passing position parameters in the tooltip both position start and position end is working same.
image

Expected behavior 🤔

position start and position end should not be same.

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
@OmPr366 OmPr366 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 17, 2023
@OmPr366
Copy link
Contributor Author

OmPr366 commented Jul 17, 2023

Can I work on it?

@zannager zannager added the component: tooltip This is the name of the generic UI component, not the React module! label Jul 17, 2023
@ZeeshanTamboli ZeeshanTamboli removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 22, 2023
@ZeeshanTamboli
Copy link
Member

ZeeshanTamboli commented Aug 22, 2023

This should work. Looks like a bug. It doesn't function properly with FormControlLabel that has a checkbox control. It does work with buttons, as illustrated here: https://mui.com/material-ui/react-tooltip/#positioned-tooltips.

@OmPr366 Feel free to work on it.

@ZeeshanTamboli ZeeshanTamboli added bug 🐛 Something doesn't work package: material-ui Specific to @mui/material labels Aug 22, 2023
@ZeeshanTamboli ZeeshanTamboli changed the title Tooltip placement [Tooltip] Not being placed correctly when used with FormControlLabel checkbox Aug 22, 2023
@Vivek-Prajapatii

This comment was marked as outdated.

@Vivek-Prajapatii

This comment was marked as outdated.

@Vivek-Prajapatii

This comment was marked as outdated.

@ZeeshanTamboli
Copy link
Member

ZeeshanTamboli commented Aug 24, 2023

@Vivek-Prajapatii In the CodeSandbox you provided (https://codesandbox.io/s/determined-engelbart-4v5mts?file=/Demo.tsx), "Bottom End" placement doesn't work as expected.

@Vivek-Prajapatii

This comment was marked as outdated.

@ZeeshanTamboli
Copy link
Member

ZeeshanTamboli commented Aug 26, 2023

@Vivek-Prajapatii Thanks for providing the solution. I do see that as a workaround, though. Why was margin-left: -11px initially included? I see that the values got changed in #8173 and #15097. But why was it added in the first place? There must be some reason. I think it got turned into a bug now. I found a similar problem with margin-right at #34039. Like there, similarly here, it would be a breaking change to remove it now. Lets keep it tracked it for v6.

@ZeeshanTamboli ZeeshanTamboli changed the title [Tooltip] Not being placed correctly when used with FormControlLabel checkbox [Tooltip] Not being placed correctly when used with FormControlLabel checkbox because of built in margin-left style Aug 26, 2023
@ZeeshanTamboli ZeeshanTamboli changed the title [Tooltip] Not being placed correctly when used with FormControlLabel checkbox because of built in margin-left style [Tooltip] Not being placed correctly when used with FormControlLabel checkbox because of built in margin-left style Aug 26, 2023
@ZeeshanTamboli ZeeshanTamboli changed the title [Tooltip] Not being placed correctly when used with FormControlLabel checkbox because of built in margin-left style [Tooltip] Not being placed correctly when used with FormControlLabel checkbox because of default margin-left style Aug 26, 2023
@ZeeshanTamboli ZeeshanTamboli added the component: FormControl The React component label Aug 26, 2023
@Vivek-Prajapatii

This comment was marked as outdated.

@gitstart
Copy link
Contributor

@OmPr366 @ZeeshanTamboli we would like to pick this up

@ZeeshanTamboli
Copy link
Member

@gitstart, as mentioned earlier, this change might be breaking, so it's better suited for v6. However, if you have a non-breaking solution, please go ahead and create a PR.

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: FormControl The React component component: tooltip This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material
Projects
None yet
Development

No branches or pull requests

8 participants