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

🐛 Unexpected jitter on MenuFlyoutSubItem appears #1014

Open
TENX-S opened this issue Jan 21, 2024 · 4 comments
Open

🐛 Unexpected jitter on MenuFlyoutSubItem appears #1014

TENX-S opened this issue Jan 21, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@TENX-S
Copy link

TENX-S commented Jan 21, 2024

When the MenuFlyoutSubItem appears, it quickly moves a short distance to the lower right corner.

bug.mp4
@TENX-S TENX-S changed the title Unexpected jitter on MenuFlyoutSubItem 🐛 Unexpected jitter on MenuFlyoutSubItem appears🐛 Jan 21, 2024
@TENX-S TENX-S changed the title Unexpected jitter on MenuFlyoutSubItem appears🐛 🐛 Unexpected jitter on MenuFlyoutSubItem appears Jan 21, 2024
@TENX-S
Copy link
Author

TENX-S commented Jan 21, 2024

This behavior can be confirmed in the example app too.
image

@bdlukaa bdlukaa added the bug Something isn't working label Jan 21, 2024
@bdlukaa
Copy link
Owner

bdlukaa commented Mar 19, 2024

This is probably because of the following lines:

@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
final context = _key.currentContext;
if (context == null) return;
final box = context.findRenderObject() as RenderBox;
setState(() => size = box.size);
});
super.initState();
}

The sub items doesn't get to know the box size at the very first frame, causing this jitter.

@TENX-S
Copy link
Author

TENX-S commented Mar 20, 2024

Yeah. I think that is the root cause. I build and run the example without the post frame callback, and the jitter is gone. But the FlyoutListTile size doesn't get right:
image

@bdlukaa
Copy link
Owner

bdlukaa commented Mar 20, 2024

Yeah. To fix this, we'd need to make use of Flutter box system - which is kind of complex. We already do it for other widgets, like ComboBox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants