fluent_ui icon indicating copy to clipboard operation
fluent_ui copied to clipboard

🐛 Unexpected jitter on `MenuFlyoutSubItem` appears

Open andrew-ares opened this issue 1 year ago • 4 comments

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

https://github.com/bdlukaa/fluent_ui/assets/40336192/8d3a0592-5ce8-4058-b8ab-de450ca35bec

andrew-ares avatar Jan 21 '24 14:01 andrew-ares

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

andrew-ares avatar Jan 21 '24 14:01 andrew-ares

This is probably because of the following lines:

https://github.com/bdlukaa/fluent_ui/blob/9c0840dc33af9d0641285b22dcda4bc553159db3/lib/src/controls/flyouts/content_manager.dart#L63-L72

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

bdlukaa avatar Mar 19 '24 21:03 bdlukaa

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

andrew-ares avatar Mar 20 '24 04:03 andrew-ares

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.

bdlukaa avatar Mar 20 '24 12:03 bdlukaa