diff --git a/Changelog.md b/Changelog.md index dc86ee58..0dcbdeda 100644 --- a/Changelog.md +++ b/Changelog.md @@ -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` diff --git a/Fluent.Ribbon/Controls/DropDownButton.cs b/Fluent.Ribbon/Controls/DropDownButton.cs index 55adaad7..0989b3c4 100644 --- a/Fluent.Ribbon/Controls/DropDownButton.cs +++ b/Fluent.Ribbon/Controls/DropDownButton.cs @@ -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); + }); + } } }