Skip to content

Commit

Permalink
Merge branch 'devel' into CB-3789-switch-color
Browse files Browse the repository at this point in the history
  • Loading branch information
dariamarutkina authored Jul 30, 2024
2 parents 24f1d39 + 45683f1 commit f9535dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion webapp/packages/core-ui/src/Tabs/Tab/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ export const Tab = observer<TabProps>(function Tab(props) {
const styles = useS(style);
const canClose = getComputed(() => !!onClose || (tab.closable && tab.state.closable));

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

return (
<TabContext.Provider value={tabContext}>
<div className={s(styles, { tabOuter: true })}>
<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
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ export const TabHandlerTab = observer<IProps>(function TabHandlerTab({ tabId, on
const handler = useTabHandler(tab.handlerId);

const TabHandlerTab = handler.getTabComponent();

return <TabHandlerTab tab={tab} handler={handler} onSelect={onSelect} onClose={onClose} />;
});

0 comments on commit f9535dd

Please sign in to comment.