Skip to content

Splitbutton Popup doesn't close #2457

@pfattisc

Description

@pfattisc

What steps will reproduce this issue?

Open Popup menu of a SplitButton in the MahApps demo -> click on the Button (PART_Button) ->
click somewhere else in the MainWindow. Popup remains open.
If the click on the Button is skipped, everything works as expected.

This seems to be an issue with Mouse.Capture in the SplitButton class:
Adding Mouse.Capture(this, CaptureMode.SubTree); to ButtonClick within SplitButton class fixes the issue.

private void ButtonClick(object sender, RoutedEventArgs e)
 {
     e.RoutedEvent = ClickEvent;
     RaiseEvent(e);
     Mouse.Capture(this, CaptureMode.SubTree);
 }

Expected outcome

Popup menu should close.

Environment

  • MahApps.Metro v1.2.4
  • Windows 7 x64
  • Visual Studio 2013
  • .NET Framework 4.5

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions