Skip to content

Commit

Permalink
fix(tabs): The tab was not fully displayed when scrollIntoView
Browse files Browse the repository at this point in the history
  • Loading branch information
l123wx committed May 20, 2024
1 parent 08c76a5 commit c212858
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/semi-foundation/tabs/tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ $ignoreIcon: '.#{$prefix}-icon-checkbox_tick, .#{$prefix}-icon-radio, .#{$prefix

.#{$module}-bar-arrow-start {
margin-right: $spacing-tabs_overflow_icon-marginRight;
& > .#{$prefix}-button {
& > .#{$prefix}-button[area-disabled=true] {
color: $color-tabs_tab-pane_arrow-text-default;
padding: $spacing-tabs_tab-pane_arrow;
border: $width-tabs_tab-pane_arrow-border solid $color-tabs_tab-pane_arrow-border-default;
Expand Down
22 changes: 12 additions & 10 deletions packages/semi-ui/tabs/TabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,20 @@ class TabBar extends React.Component<TabBarProps, TabBarState> {
};

renderCollapse = (items: Array<OverflowItem>, icon: ReactNode, pos: 'start' | 'end'): ReactNode => {
const arrowCls = cls({
[`${cssClasses.TABS_BAR}-arrow-${pos}`]: pos,
[`${cssClasses.TABS_BAR}-arrow`]: true,
});

if (isEmpty(items)) {
return (
<Button
disabled={true}
icon={icon}
theme="borderless"
/>
<div role="presentation" className={arrowCls}>
<Button
disabled={true}
icon={icon}
theme="borderless"
/>
</div>
);
}
const { dropdownClassName, dropdownStyle } = this.props;
Expand All @@ -175,11 +182,6 @@ class TabBar extends React.Component<TabBarProps, TabBarState> {
</Dropdown.Menu>
);

const arrowCls = cls({
[`${cssClasses.TABS_BAR}-arrow-${pos}`]: pos,
[`${cssClasses.TABS_BAR}-arrow`]: true,
});

const dropdownCls = cls(dropdownClassName, {
[`${cssClasses.TABS_BAR}-dropdown`]: true,
});
Expand Down

0 comments on commit c212858

Please sign in to comment.