bdlukaa / bdlukaa/fluent_ui

🐛 `MenuFlyout` is immediately closed on iOS

Open
#1,326 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Dart
Stars
3.5k
Forks
506
Avg merge
11d 2h
Merged PRs (30d)
3

Description

**Describe the bug**
Attempting to use a `FlyoutController` to show a `MenuFlyout` does not work on iOS. You can occasionally see what I believe is the flyout appearing for a frame or two before going away. Otherwise, a button that shows a `MenuFlyout` usually looks like it isn't showing any flyout at all. The flyout controller can show other widgets as flyouts (e.g., just a `Text`).

**Additional context**
`MenuFlyout` works just fine on Windows, Android, Web, and MacOS (I have verified with the snippet below).

**To Reproduce**
Snippet to reproduce:
```dart
import 'package:fluent_ui/fluent_ui.dart';

void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(MainApp());
}

class MainApp extends StatelessWidget {
MainApp({super.key});

final controller = FlyoutController();

@override
Widget build(BuildContext context) {
return FluentApp(
home: ScaffoldPage(
content: Center(
child: FlyoutTarget(
controller: controller,
child: IconButton(
icon: Icon(FluentIcons.activity_feed),
onPressed: () {
controller.showFlyout(
builder: (context) {
// TODO: Uncomment to see this work fine.
// return Text('This works fine');

return MenuFlyout(
items: [
MenuFlyoutItem(
text: Text('Option 1'),
onPressed: () {
print('Option 1 - pressed');
},
),
],
);
},
);
},
),
),
),
),
);
}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the provided Flutter snippet on iOS and compare the MenuFlyout behavior with the Text flyout, which remains visible. Trace the FlyoutController.showFlyout path and MenuFlyout rendering or dismissal behavior; done means the menu stays open on iOS and its item can be pressed, while existing platforms continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
frontend, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.