Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tabs): 修复card主题下onDragSort的targetIndex参数不正确的问题 #1455

Merged
merged 1 commit into from
Aug 19, 2022
Merged
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
2 changes: 1 addition & 1 deletion src/hooks/useDragSort.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function useDragSort(props: any) {

// 当props.theme === "normal" 会多出一个指示条为第一个dom节点,所以需要减1
const currentIndex = props.theme === 'card' ? dragIndex : dragIndex - 1;
const endIndex = props.theme === 'card' ? dragIndex : targetIndex - 1;
const endIndex = props.theme === 'card' ? targetIndex : targetIndex - 1;
props.onDragSort({
currentIndex,
current: props.panels[currentIndex].value,
Expand Down