Skip to content

Commit

Permalink
fix: Correctly disable DropDownButton items if onPressed is not p…
Browse files Browse the repository at this point in the history
…rovided (#1116)
  • Loading branch information
bdlukaa committed Sep 29, 2024
1 parent 2a2fc6d commit bde4752
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- fix : The EditableComboBox is missing the part that applies the style to the TextBox, so add it.
- feat: Add `BreadcrumbBar.chevronIconBuilder` and `BreadcrumbBar.chevronIconSize` ([#1111](https://github.com/bdlukaa/fluent_ui/issues/1111))
* fix: Consider object translation on Menu Flyouts ([#1104](https://github.com/bdlukaa/fluent_ui/issues/1104))
* fix: Correctly disable `DropDownButton` items if `onPressed` is not provided ([#1116](https://github.com/bdlukaa/fluent_ui/issues/1116#issuecomment-2347153074))

## 4.9.1

Expand Down
4 changes: 2 additions & 2 deletions example/lib/screens/inputs/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ ToggleButton(
items: [
MenuFlyoutItem(text: const Text('Send'), onPressed: () {}),
MenuFlyoutSeparator(),
MenuFlyoutItem(text: const Text('Reply'), onPressed: () {}),
MenuFlyoutItem(text: const Text('Reply'), onPressed: null),
MenuFlyoutItem(text: const Text('Reply all'), onPressed: () {}),
],
)''',
Expand All @@ -280,7 +280,7 @@ ToggleButton(
items: [
MenuFlyoutItem(text: const Text('Send'), onPressed: () {}),
MenuFlyoutSeparator(),
MenuFlyoutItem(text: const Text('Reply'), onPressed: () {}),
MenuFlyoutItem(text: const Text('Reply'), onPressed: null),
MenuFlyoutItem(text: const Text('Reply all'), onPressed: () {}),
],
),
Expand Down
4 changes: 1 addition & 3 deletions lib/src/controls/inputs/dropdown_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,7 @@ class DropDownButtonState extends State<DropDownButton> {

MenuFlyoutItem _createMenuItem(MenuFlyoutItem item, BuildContext context) {
return MenuFlyoutItem(
onPressed: () {
item.onPressed?.call();
},
onPressed: item.onPressed,
closeAfterClick: widget.closeAfterClick,
key: item.key,
leading: item.leading,
Expand Down

0 comments on commit bde4752

Please sign in to comment.