Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DropDownButton closes when nested Popup closes #1400

Closed
bozalina opened this issue Nov 2, 2018 · 1 comment
Closed

DropDownButton closes when nested Popup closes #1400

bozalina opened this issue Nov 2, 2018 · 1 comment

Comments

@bozalina
Copy link

bozalina commented Nov 2, 2018

If you place a Popup, such as one from a ComboBox, inside a DropDownButton and click outside the nested Popup, the DropDownButton's Popup closes as well.

To reproduce, place a ComboBox inside the DropDownButton sample in the explorer:

<xctk:DropDownButton x:Name="_dropDownButton"
                               Grid.Row="1"
                               Margin="10"
                               Width="150"
                               HorizontalAlignment="Left"
                               Content="Click Me"
                               MaxDropDownHeight="{Binding Value, ElementName=maxDropDownHeight}"
                               DropDownPosition="{Binding SelectedItem, ElementName=dropDownPosition}"
                               DropDownContentBackground="{Binding SelectedColor, ElementName=dropDownContentBackground, Converter={StaticResource ColorToSolidColorBrushConverter}}"
                               Click="DropDownButton_Click">
            <xctk:DropDownButton.DropDownContent>
              <StackPanel>
                <xctk:ColorCanvas Margin="10"/>
                  <ComboBox>
                    <ComboBox.Items>
                      <sys:String>Item</sys:String>
                    </ComboBox.Items>
                  </ComboBox>
                <Button Click="Button_Click"
                        Margin="10">OK</Button>
              </StackPanel>
            </xctk:DropDownButton.DropDownContent>
          </xctk:DropDownButton>

Run the explorer and open the ComboBox. Click outside the ComboBox's Popup, but within the DropDownButton's PopUp. Observe that the DropDownButton closes as well. It seems to be caused by the PreviewMouseDownOutsideCapturedElement event tunneling through the DropDownButton's Popup to the ComboBox's Popup.

@XceedBoucherS
Copy link
Collaborator

Thank you for reporting this.
The fix will be included in v3.8.

Dirkster99 added a commit to Dirkster99/DropDownButtonLib that referenced this issue Dec 13, 2018
Checking if the mouse is outside the bounds of the DropDownButton when the PreviewMouseDownOutsideCapturedElement event tunnels through it to prevent the DropDownButton's Popup from closing if the event is caused by a child Popup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants