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

BUG: Popup closing when releasing the mouse outside #3577

Open
mhsdesign opened this issue Jul 11, 2023 · 0 comments
Open

BUG: Popup closing when releasing the mouse outside #3577

mhsdesign opened this issue Jul 11, 2023 · 0 comments
Labels
7.3 Bug Label to mark the change as bugfix

Comments

@mhsdesign
Copy link
Member

mhsdesign commented Jul 11, 2023

Strongly related to #3531

_Originally posted by @patricekaufmann in #3531 and edited / brought into context by me ;)

The node-creation dialog will close accidentally, when selecting the text in the text inputs and releasing the mouse outside of the dialog. This will actually be fixed with #3579 but as later described, the main problem is that we trigger a close even when the mouse down even was fired inside the dialog

I think having the NodeType Selection dialog still be closable by mouse would be nice as sometimes I have the wrong element selected when trying to insert a node. For this dialog, having it only trigger the close action when the MosueDown happened outside of the dialog aswell would be a welcome addition for these cases.


The fix #3579 would still lead to the popup closing when, for example, the user tries to select text inputs for properties with defaultValue set and then releasing the mouse outside. It would still be annoying occasionaly because the text inputs are so close to the left popup edge that it will happen from time to time.

The origin for this behaviour is the onClick listener in dialog.tsx, because ev.target only refers to the element where the MouseUp event triggered, eg. the target for MouseDown could have been the popup, and not the sorrounding section.

    private readonly handleOverlayClick = (ev: React.MouseEvent) => {
        if (ev.target === ev.currentTarget) {
            this.props.onRequestClose();
        }
    }

To add to the previous post, the MouseUp / MouseDown mechanic also applies to other dialogs:

jfgR0lk4O5.mp4

When the MouseDown event triggers on the Button and MouseUp on the outside overlay section, it should not trigger the close event.

@crydotsnake crydotsnake added Bug Label to mark the change as bugfix 7.3 labels Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7.3 Bug Label to mark the change as bugfix
Projects
None yet
Development

No branches or pull requests

2 participants