Skip to content

Commit 1a6768e

Browse files
authoredMar 18, 2022
fix(Tabs): 高亮下划线位置错误 #674 (#677)
1 parent d20b5e8 commit 1a6768e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎packages/react-tabs/src/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export default function Tabs(props: TabsProps) {
105105
if (activeItem.current && type === 'line') {
106106
setSlideStyle({
107107
width: activeItem.current.clientWidth,
108-
left: activeItem.current.offsetLeft + 15,
108+
left: activeItem.current.offsetLeft,
109109
});
110110
}
111111
}
@@ -117,10 +117,10 @@ export default function Tabs(props: TabsProps) {
117117
<div className={`${prefixCls}-bar`} ref={divContentRef}>
118118
<div className={`${prefixCls}-nav`} style={{ width: 'max-content' }}>
119119
{renderNav(children)}
120+
<div style={slideStyle} className={`${prefixCls}-slide`} />
120121
</div>
121122
</div>
122123
</div>
123-
<div style={slideStyle} className={`${prefixCls}-slide`} />
124124
{hiddenNav.length > 0 && (
125125
<Popover
126126
trigger="click"

‎packages/react-tabs/src/style/index.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
&-line &-slide {
6161
background-color: #108ee9;
6262
box-sizing: border-box;
63-
bottom: 45px;
63+
bottom: 0;
6464
position: absolute;
6565
height: 1px;
6666
left: 0;

0 commit comments

Comments
 (0)
Please sign in to comment.