Skip to content

Commit

Permalink
Fixes #1227
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Jan 6, 2025
1 parent 3ba9973 commit d0034e9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
- [#1196](../../issues/1196) - GroupName causes the selected ToggleButton to no longer trigger the click event
- [#1218](../../issues/1218) - Selected tab is lost on screen changes (thanks @cbra-caa)
- [#1222](../../issues/1222) - Icon property values of controls are translated by the translation tools like catalyst (thanks @avikramaditya)
- [#1227](../../issues/1227) - Button events inside split button do not fire when ClosePopupOnMouseDownDelay = 0
- Value of `HideContextTabs` are now properly restored when `Backstage` is closed
- `RibbonTitleBar`
- Fixed rendering when `HideContextTabs` is `true`
Expand Down
17 changes: 12 additions & 5 deletions Fluent.Ribbon/Controls/DropDownButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -578,13 +578,20 @@ private void OnDropDownPopupMouseDown(object sender, RoutedEventArgs e)
// Note: get outside thread to prevent exceptions (it's a dependency property after all)
var timespan = this.ClosePopupOnMouseDownDelay;

// Ugly workaround, but use a timer to allow routed event to continue
Task.Factory.StartNew(async () =>
if (timespan <= 0)
{
await Task.Delay(timespan);
this.IsDropDownOpen = false;
}
else
{
// Ugly workaround, but use a timer to allow routed event to continue
Task.Factory.StartNew(async () =>
{
await Task.Delay(timespan);

this.RunInDispatcherAsync(() => this.IsDropDownOpen = false);
});
this.RunInDispatcherAsync(() => this.IsDropDownOpen = false);
});
}
}
}

Expand Down

0 comments on commit d0034e9

Please sign in to comment.