-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat: add middle click dashboard tab deletion #1992
feat: add middle click dashboard tab deletion #1992
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
@@ -67,6 +67,12 @@ const NavTab = memo( | |||
data-testid={`btn-nav-tab-${title}`} | |||
role="tab" | |||
tabIndex={0} | |||
onAuxClick={event => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think onAuxClick works in safari.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will take a look into this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case you probably will need onMouseUp
or onMouseDown
(check behavior of the golden-layout tabs) and check event.buttons===4
I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's 1 not 4, and you should be able to get it from just the click event I would think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tab
component seems to use:
this.element.on('click', this._onTabClick);
this.element.on('auxclick', this._onTabClick);
@dsmmcken any idea if jQuery is making auxclick
work in Safari, or is there something else happening here? I don't see anything special otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you check middle click to close actually works on Safari with golden layout? If so, then jQuery is polyfilling the functionality. If not, then we just never tested it works in Safari
You would want to check both button and buttons on mouseUp because you could start dragging, then middle click on accident and possibly get into a very weird state. You just need to check 2 values, so I'm not sure how it's that complicated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking into it currently, will update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Middle click does work with Safari golden layout.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm following now. Seems like mouseUp
event with a button === 1 && buttons === 0
check is the simplest approximation. Just means that if you click down elsewhere and drag onto the tab and then release it would close the tab, but that doesn't really seem like a concern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spoke to Matt, pushing changes shortly.
I have read the CLA Document and I hereby sign the CLA |
recheck |
recheck |
6ff5f98
to
538632c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. I verified everything works as expected on Chrome + Safari.
Left minor suggestion for comment tweaks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Resolves #1990