Skip to content

Commit

Permalink
fix(Tabs): 高亮下划线位置错误 #674 (#677)
Browse files Browse the repository at this point in the history
  • Loading branch information
Amber-Nan committed Mar 18, 2022
1 parent d20b5e8 commit 1a6768e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/react-tabs/src/index.tsx
Expand Up @@ -105,7 +105,7 @@ export default function Tabs(props: TabsProps) {
if (activeItem.current && type === 'line') {
setSlideStyle({
width: activeItem.current.clientWidth,
left: activeItem.current.offsetLeft + 15,
left: activeItem.current.offsetLeft,
});
}
}
Expand All @@ -117,10 +117,10 @@ export default function Tabs(props: TabsProps) {
<div className={`${prefixCls}-bar`} ref={divContentRef}>
<div className={`${prefixCls}-nav`} style={{ width: 'max-content' }}>
{renderNav(children)}
<div style={slideStyle} className={`${prefixCls}-slide`} />
</div>
</div>
</div>
<div style={slideStyle} className={`${prefixCls}-slide`} />
{hiddenNav.length > 0 && (
<Popover
trigger="click"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-tabs/src/style/index.less
Expand Up @@ -60,7 +60,7 @@
&-line &-slide {
background-color: #108ee9;
box-sizing: border-box;
bottom: 45px;
bottom: 0;
position: absolute;
height: 1px;
left: 0;
Expand Down

0 comments on commit 1a6768e

Please sign in to comment.