Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/tabs/tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ export function Tab({ tab, active, ...restEvents }: ITabComponent) {
tabItemClassName,
status ? 'status' : 'op'
)}
onClick={() => onCloseTab?.(id)}
onClick={(e) => {
e.stopPropagation();
onCloseTab?.(id);
}}
renderStatus={(isHover) => renderStatus(status, isHover)}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/tabs/tabExtra.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getBEMElement } from 'mo/common/className';

interface ITabExtraProps {
classNames?: string;
onClick?: () => void;
onClick?: React.MouseEventHandler<HTMLDivElement>;
renderStatus?: (hover: boolean) => JSX.Element;
}

Expand Down
5 changes: 1 addition & 4 deletions src/controller/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,8 @@ export class PanelController extends Controller implements IPanelController {
}

public readonly onTabChange = (key: UniqueId): void => {
const state = this.panelService.getState();
if (key) {
this.panelService.setState({
current: state.data?.find((item) => item.id === key),
});
this.panelService.setActive(key);
}
this.emit(PanelEvent.onTabChange, key);
};
Expand Down