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
Toolbar buttons fire on right-click down #6691
Comments
Agreed about right click. We investigated the mousedown vs mouseup behavior, and it turns out that lots of buttons in toolbars actually take action on mousedown. |
Reference: https://github.com/jupyterlab/jupyterlab/blob/master/packages/apputils/src/toolbar.tsx#L462 Is there any reason why we can't use mouseup? |
After Jason's comment, I remember there having been a discussion about this (with AlbertHilb I think). If somebody knows where that was and can crossref it, that would be appreciated :) |
@AlbertHilb To fix this, we could use mouseup vs. mousedown. Do you have any objections to that? |
There are ux questions around using mouse up vs mouse down. @ellisonbg and I looked at a few existing patterns, and there was definitely precedence for mouse down. |
The default browser action on |
@AlbertHilb Thanks for the detailed explanation. Losing editor focus seems like a good enough motivation for me. Maybe we should include a comment next to the event binding in the code to prevent this from coming up again 😅 |
We have wrestled previously with actions (toolbar buttons, menu items) that blur editor focus. Interacting with elements outside the editor should in fact blur the editor as those other elements should receive focus. Disrupting that will only cause accessibility problems and weird side effects. A separate question is whether we should trigger on up/down. I don't remember off hand which UI toolkits handle it which way, but it was not at all consistent between them, or between keyboard and mouse. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related discussion. |
When using the toolbar buttons, I notice that they fire their actions on:
Both of which I would consider unexpected, and annoying (right click should give context menu, and I should be able to abort my action mid-click by dragging the mouse off the button before releasing).
The text was updated successfully, but these errors were encountered: