feat: add middle click dashboard tab deletion#1992
feat: add middle click dashboard tab deletion#1992AkshatJawne merged 4 commits intodeephaven:mainfrom
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
| data-testid={`btn-nav-tab-${title}`} | ||
| role="tab" | ||
| tabIndex={0} | ||
| onAuxClick={event => { |
There was a problem hiding this comment.
I don't think onAuxClick works in safari.
There was a problem hiding this comment.
Will take a look into this
There was a problem hiding this comment.
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.
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.
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.
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.
Looking into it currently, will update
There was a problem hiding this comment.
Middle click does work with Safari golden layout.
There was a problem hiding this comment.
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.
Spoke to Matt, pushing changes shortly.
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
|
recheck |
6ff5f98 to
538632c
Compare
bmingles
left a comment
There was a problem hiding this comment.
Changes look good. I verified everything works as expected on Chrome + Safari.
Left minor suggestion for comment tweaks
Resolves #1990