When building a FluentTextSelectionToolbar to return to the contextMenuBuilder argument of a SelectableRegion, the list of ContextMenuButtonItem passed to buttonItems must not contain any type other than either cut, copy, paste, selectAll or custom.
If you use types like lookUp or searchWeb, the option will just not appear in the context menu.
To Reproduce
- Create a new Flutter project using the fluent_ui package
- Create a SelectableRegion around one or more Text widgets
- Pass a function to the contextMenuBuilder argument that returns a FluentTextSelectionToolbar
- In this FluentTextSelectionToolbar, pass one or more ContextMenuButtonItem items to the buttonItems argument, setting the type to either lookUp, searchWeb or share
- When oppening the menu, the item won't be there
Expected behavior
The item should appear in the context menu for the selected text
Additional context
The issue seems to be on line 134 to 161 of file selection_controls.dart (as of version 4.15). The list of items is filtered into an orderedButtons variable and only the cited types are taken into account. Any types not in this list are simply not included.
To make things worse, this same file seems to take these extra types into account for other methods like contextMenuTypeToShortcut and contextMenuTypeToIcon.
When building a FluentTextSelectionToolbar to return to the contextMenuBuilder argument of a SelectableRegion, the list of ContextMenuButtonItem passed to buttonItems must not contain any type other than either cut, copy, paste, selectAll or custom.
If you use types like lookUp or searchWeb, the option will just not appear in the context menu.
To Reproduce
Expected behavior
The item should appear in the context menu for the selected text
Additional context
The issue seems to be on line 134 to 161 of file selection_controls.dart (as of version 4.15). The list of items is filtered into an
orderedButtonsvariable and only the cited types are taken into account. Any types not in this list are simply not included.To make things worse, this same file seems to take these extra types into account for other methods like
contextMenuTypeToShortcutandcontextMenuTypeToIcon.