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: 修复手动排序在单行头且维值相似的场景不生效 #3019

Merged
merged 4 commits into from
Dec 9, 2024

Conversation

lijinke666
Copy link
Member

👀 PR includes

🐛 Bugfix

  • Solve the issue and close

📝 Description

originValues: [
  '我也是测1试',
  '我是测试',
  '我也是测试',
  '我也是测试1',
  '我也是1测试',
  '测试',
],
sortByValues: ['测试', '我是测试']

🖼️ Screenshot

Before After

🔗 Related issue link

🔍 Self-Check before the merge

  • Add or update relevant docs.
  • Add or update relevant demos.
  • Add or update test case.
  • Add or update relevant TypeScript definitions.

Copy link

vercel bot commented Dec 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
antvis-s2 ❌ Failed (Inspect) Dec 9, 2024 11:26am

@github-actions github-actions bot added pr(fix) bug fix next 2.0-next 版本的问题 labels Dec 9, 2024
@@ -108,8 +108,10 @@ export const sortByCustom = (params: SortActionParams): string[] => {
const { sortByValues = [], originValues = [] } = params;

// 从 originValues 中过滤出所有包含 sortByValue 的 id
const idWithPre = originValues.filter((originItem) =>
sortByValues.find((value) => endsWith(originItem, value)),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原来使用 endSWidth 去匹配, 以单测的场景, 按 "测试" 手动排序, 如果维值是 "我是测试", 也会命中, 导致将 我是测试 排到最上方

Copy link
Contributor

github-actions bot commented Dec 9, 2024

Size Change: 0 B

Total Size: 618 kB

ℹ️ View Unchanged
Filename Size
./packages/s2-core/dist/s2-extends.min.js 154 kB
./packages/s2-core/dist/s2.min.css 581 B
./packages/s2-core/dist/s2.min.js 257 kB
./packages/s2-react-components/dist/s2-react-components.min.css 2.55 kB
./packages/s2-react-components/dist/s2-react-components.min.js 124 kB
./packages/s2-react/dist/s2-react.min.css 1.74 kB
./packages/s2-react/dist/s2-react.min.js 38.3 kB
./packages/s2-vue/dist/s2-vue.min.css 2.05 kB
./packages/s2-vue/dist/s2-vue.min.js 38.3 kB

compressed-size-action

@lijinke666 lijinke666 merged commit 6221958 into next Dec 9, 2024
6 of 8 checks passed
@lijinke666 lijinke666 deleted the fix-sort-by branch December 9, 2024 11:26
@lijinke666
Copy link
Member Author

🎉 This PR is included in version @antv/s2-v2.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next 2.0-next 版本的问题 pr(fix) bug fix released on @latest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants