Skip to content

Commit

Permalink
fix: closes tabs for Safari also
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyteleshev committed Jul 25, 2024
1 parent 9226a93 commit 2565c6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webapp/packages/core-ui/src/Tabs/Tab/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ export const Tab = observer<TabProps>(function Tab(props) {
const styles = useS(style);
const canClose = getComputed(() => !!onClose || (tab.closable && tab.state.closable));

function onAuxClickHandler(event: React.MouseEvent<HTMLDivElement>) {
function onMouseUpHandler(event: React.MouseEvent<HTMLDivElement>) {
if (event.button === 1 && props.closeOnMouseWheelClick && canClose) {
tab.handleClose(event);
}
}

return (
<TabContext.Provider value={tabContext}>
<div className={s(styles, { tabOuter: true })} onAuxClick={onAuxClickHandler}>
<div className={s(styles, { tabOuter: true })} onMouseUp={onMouseUpHandler}>
<div className={s(styles, { tabInner: true, tabInnerSelected: tab.selected })}>
<TabActions
className={s(styles, { actions: true })}
Expand Down

0 comments on commit 2565c6f

Please sign in to comment.