Skip to content

Commit

Permalink
fix(tabs): clicked tabs should be entirely visible (#2685)
Browse files Browse the repository at this point in the history
* fix: tabs should show left edge

* fix: update lock to fix ci insatall failed

* fix: ci failed

* fix: ci failed

* fix: build

* fix: build
  • Loading branch information
Alex-huxiyang authored Nov 1, 2024
1 parent b97e0a5 commit 08bab87
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/packages/configprovider/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ export type NutCSSVariables =
| 'nutuiDividerSpacing'
| 'nutuiDividerSideWidth'
| 'nutuiDividerVerticalHeight'
| 'nutuiDividerVerticalTop'
| 'nutuiDividerVerticalMargin'
| 'nutuiIconHeight'
| 'nutuiIconWidth'
Expand Down
2 changes: 1 addition & 1 deletion src/packages/range/range.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const Range: FunctionComponent<

const classPrefix = 'nut-range'
const [buttonIndex, setButtonIndex] = useState(0)
const [dragStatus, setDragStatus] = useState('start' || 'draging' || '')
const [dragStatus, setDragStatus] = useState('start')
const touch = useTouch()
const root = useRef<HTMLDivElement>(null)
const [marksList, setMarksList] = useState<number[]>([])
Expand Down
2 changes: 1 addition & 1 deletion src/packages/range/range.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const Range: FunctionComponent<

const classPrefix = 'nut-range'
const [buttonIndex, setButtonIndex] = useState(0)
const [dragStatus, setDragStatus] = useState('start' || 'draging' || '')
const [dragStatus, setDragStatus] = useState('start')
const touch = useTouch()
const root = useRef<HTMLDivElement>(null)
const [marksList, setMarksList] = useState<number[]>([])
Expand Down
5 changes: 1 addition & 4 deletions src/packages/tabs/tabs.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,7 @@ export const Tabs: FunctionComponent<Partial<TabsProps>> & {
const left = titleRects
.slice(0, index)
.reduce((prev: number, curr: RectItem) => prev + curr.width, 0)
to = left - (navRectRef.current.width - titleRect.width) / 2
// to < 0 说明不需要进行滚动,页面元素已全部显示出来
if (to < 0) return
to = rtl ? -to : to
to = rtl ? -left : left
}
nextTick(() => {
scrollWithAnimation.current = true
Expand Down

0 comments on commit 08bab87

Please sign in to comment.