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

Close clipboard if clicked outside #122

Merged
merged 4 commits into from
Jul 16, 2024
Merged

Conversation

manics
Copy link
Member

@manics manics commented Jul 12, 2024

I think it's more natural for the clipboard to automatically close when you click the desktop outside it, e.g. to paste something into the desktop. Currently you have to click the button again to close it.

@manics manics added the enhancement New feature or request label Jul 12, 2024
Copy link

github-actions bot commented Jul 12, 2024

Binder 👈 Launch a binder notebook on this branch for commit f337437

I will automatically update this comment whenever this PR is modified

Binder 👈 Launch a binder notebook on this branch for commit b4ef5ac

Binder 👈 Launch a binder notebook on this branch for commit 05c6af9

Binder 👈 Launch a binder notebook on this branch for commit f88af7d

@yuvipanda
Copy link
Contributor

Screen.Recording.2024-07-12.at.3.11.02.PM.mov

This only seems to close it if clicked on the canvas, and not on the background or elsewhere on the bar.

Can we attach the event to body or similar so it hides when clicked anywhere outside?

@manics
Copy link
Member Author

manics commented Jul 14, 2024

I originally restricted it to the canvas to reduce the chance of complex interactions if we added more items to the menu bar or background area in future. I've changed it to document.body in the last commit.

@manics
Copy link
Member Author

manics commented Jul 15, 2024

This will require attaching handlers to multiple elements, as NoVNC attaches an onclick handler to canvas with stopPropagation, so the handler on the parent element isn't called.

@yuvipanda yuvipanda merged commit 5fa250b into jupyterhub:main Jul 16, 2024
7 checks passed
@yuvipanda
Copy link
Contributor

Tested and it works! Thank you @manics

@manics manics deleted the clipboard-close branch July 16, 2024 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants