-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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][material] When open, the Controlled Tooltip does not follow the target object when it is moved #38832
Comments
Thanks for the report, @m-tartari! This seems like a bug. I've added the |
I can look into this one! |
@adamhylander thanks! please do 😊 |
@DiegoAndai I can look into it if it is still open |
Thanks for the interest @SyedZain714, I think @adamhylander is working on it. Feel free to collaborate on this issue as well. |
@SyedZain714 Yes I am working on it right now. I wanna try by myself a bit more but how about I message you when I get stuck? Does that work for you? |
Ok
…On Tue, Sep 26, 2023, 1:34 PM adamhylander ***@***.***> wrote:
@SyedZain714 <https://github.com/SyedZain714> Yes I am working on it
right now. I wanna try by myself a bit more but how about I message you
when I get stuck? Does that work for you?
—
Reply to this email directly, view it on GitHub
<#38832 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASRODU7FNEMVHJFEYXSJYULX4KHSHANCNFSM6AAAAAA4NHWUQ4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@SyedZain714 Hi, you can look into this issue now if you'd like. Can't seem to solve it. Thank you for being patient! |
Ok, I'll check it out.
Also can you tell your findings related to it.
…On Tue, Oct 3, 2023, 12:39 PM adamhylander ***@***.***> wrote:
@SyedZain714 <https://github.com/SyedZain714> Hi, you can look into this
issue now if you'd like. Can't seem to solve it. Thank you for being
patient!
—
Reply to this email directly, view it on GitHub
<#38832 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASRODU26NT6OC3FS2AVLJGTX5O6LVAVCNFSM6AAAAAA4NHWUQ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBUGM3TKNBUG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hey, I went back to this issue again and found the core issue. The issue is that the above example has transition animations which causes a kind of race condition between the animation and the tooltip positioning code. So for example when the page is freshly loaded the following occurs
Pressing the SideDrawerButton again and what happens is:
I am not sure how to fix it though. Here is code from MainWorkspace.tsx that correctly positions the tooltip, note that it is about the transition: export function getStyle(
theme: Theme,
sideDrawerWidth: string,
compactView: boolean
): React.CSSProperties {
return {
padding: `0 ${theme.spacing(1)}`,
width: '100%',
marginTop: '0',
marginLeft: '0',
marginBottom: '0',
zIndex: theme.zIndex.drawer,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
gap: theme.spacing(1),
// side drawer closed
marginRight: `-${sideDrawerWidth}`,
transition: theme.transitions.create(['margin', 'gridTemplateColumns'], {
easing: 'linear', // Instant transition
duration: '0ms', // No duration
}),
// side drawer open
...(compactView && {
marginRight: 0,
transition: theme.transitions.create(['margin', 'gridTemplateColumns'], {
easing: 'linear', // Instant transition
duration: '0ms', // No duration
}),
}),
};
} I also noted that the demo given by the author had some ambiguous index.ts files which had to be redone for the playground environment and was quite annoying to fix. A fully functional playground demo can be found here: |
Hey, is this bug still open? |
@adamhylander's workaround by making the transition instant works. Thanks for providing such a detailed explanation. I'm sorry I didn't reply before. Of course, the workaround could be better as the transition is instant and not smooth. For an implementation that allows an actual transition, we could explore hooking into the drawer's |
Duplicates
Latest version
Steps to reproduce 🕹
Link to live example: Codesandbox (repo: m-tartari/material-ui-issue-38832)
Steps:
Install dependencies and start the app:
Use the button to open/close the sidedrawer.
Current behavior 😯
When open, the tooltip does not follow the target object. Scrolling resets the position
screen-capture.mp4
Expected behavior 🤔
The Tooltip should move with the target object or refresh its position at the end of the transition.
Context 🔦
I need to display multiple text-free items in a workspace similar to the one in the video. The tooltip is used to display item information on hover but can be set to be always open from the app setting to simplify object tracking.
Your environment 🌎
npx @mui/envinfo
The text was updated successfully, but these errors were encountered: