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

Help screen popup closes if you click anywhere #37

Open
gsuberland opened this issue Aug 9, 2023 · 0 comments · May be fixed by #40
Open

Help screen popup closes if you click anywhere #37

gsuberland opened this issue Aug 9, 2023 · 0 comments · May be fixed by #40

Comments

@gsuberland
Copy link

Describe the bug
If you open the help screen from the menu, then click anywhere, the help screen closes.

The current behaviour makes it impossible to select text on the help page, either for copy/paste or for other use-cases of text highlighting like tracking your reading position.

To Reproduce
Steps to reproduce the behaviour:

  1. Open the dropdown menu.
  2. Click on 'help'.
  3. Click anywhere on the screen, including the help popup itself.
  4. The popup will close when you release your mouse button.

Expected behaviour
I would expect that the help screen would only close when clicking on the 'Close' button, or outside the bounds of the help screen.

Environment:
Tested on Chrome 115.0.5790.170 and Firefox 116.0.2, both on a Windows 10 desktop.

Additional context

The relevant code is:

help?.addEventListener("click", () => {
help.close()
})

This sets the click event callback for the dialog itself, rather than the close button within the dialog. The close button itself does not have a click event handler at all, so when you click the button the event bubbles up to the parent dialog element. I suspect this was a case of mistakenly applying the close callback to the dialog element rather than the button element.

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.

1 participant