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

Popup Windows not closing on Form click/move. #65

Closed
dax-leo opened this issue Jul 19, 2023 · 1 comment · Fixed by #66
Closed

Popup Windows not closing on Form click/move. #65

dax-leo opened this issue Jul 19, 2023 · 1 comment · Fixed by #66

Comments

@dax-leo
Copy link

dax-leo commented Jul 19, 2023

Problem description:

  1. open combobox
    image
  2. We can move the form but combobox will stay open.
    image

Maybe changing :

protected override void OnMouseDown (MouseEventArgs e)
{
base.OnMouseDown (e);
// We won't get a MouseUp from the system for this, so don't capture the mouse
Capture = false;
FindForm ()?.BeginMoveDrag ();
}

to :

protected override void OnMouseDown (MouseEventArgs e)
        {
            base.OnMouseDown (e);

            // Reset any popup left open
            FindForm ().adapter.SelectedControl?.Deselect ();
            FindForm ().adapter.SelectedControl?.Select ();

            // We won't get a MouseUp from the system for this, so don't capture the mouse
            Capture = false;
            FindForm ()?.BeginMoveDrag ();
        }

This way parent control (that is FindForm ().adapter.SelectedControl) will automatically trigger popup close.

@jpobst
Copy link
Collaborator

jpobst commented Jul 22, 2023

Should be fixed with #66. I tried to unify the code a bit with the existing mechanism that handles this for menus.

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