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: autoComplete can't scroll when keyboard up and down, #1530 #2501

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

pointhalo
Copy link
Collaborator

@pointhalo pointhalo commented Sep 18, 2024

中文模板 / Chinese Template

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Test Case
  • TypeScript definition update
  • Document improve
  • CI/CD improve
  • Branch sync
  • Other, please describe:

PR description

  • AutoComplete 未提供如 Select 般,使用键盘上下键切换后选项时,自动将其滚动至视图中的能力,见issue [AutoComplete] 使用方向键切换选项后,希望自动滚动 #1530。本 PR主要修复该问题

    • 参考了 Select中的做法,调整scrollTop值
    • 同时在过程中发现 autocomplete的 constant.js 中关于 dom的classname存在两种写法:autoComplete、autocomplete,本次统一为后者(即修改子组件,不动父组件)。同时更新单测中的选择器(原单测也存在两种写法,非正常情况)
  • 顺带修正的问题

    • storybook的main.js中 console.log 使用到了 chalk,但依赖声明未包含,因此显式增加了依赖(仅对本 monorepo工程作用,对用户无影响)
    • 升级了 webpack-cli (v3 -> v5),避免npm run boostrap时的 warning

Changelog

🇨🇳 Chinese

  • Fix: 修复 AutoComplete 选项多于一页时,使用键盘 ArrowUp、ArrowDown切换时无法自动滚动至视图中的问题 [AutoComplete] 使用方向键切换选项后,希望自动滚动 #1530
  • Fix:修复 AutoComplete 的子组件 className 大小写与父组件(.semi-autocomplete)不一致的问题(.semi-autoComplete-option -> .semi-autocompelte-option),一致改为小写

🇺🇸 English

  • Fix: Fixed AutoComplete option when more than one page, when using keyboard ArrowUp, ArrowDown switch can not automatically scroll to view issue [AutoComplete] 使用方向键切换选项后,希望自动滚动 #1530
  • Fix: Fix the problem that the case of the child component className of AutoComplete is inconsistent with the parent component, and the consistent is changed to lowercase (.semi-autoComplete-option - > .semi-autocompelte-option)

Checklist

  • Test or no need
  • Document or no need
  • Changelog or no need

Other

  • Skip Changelog

Additional information

Copy link

codesandbox-ci bot commented Sep 18, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit da30645:

Sandbox Source
pr-story Configuration

Copy link

cypress bot commented Sep 18, 2024

semi-design    Run #2836

Run Properties:  status check passed Passed #2836  •  git commit 2f31c145a1 ℹ️: Merge da30645c8d4216d4bc17948cd8e72da1f0736b95 into 8a0c32124fb0ca5cfde700c1c128...
Project semi-design
Branch Review fix-1530
Run status status check passed Passed #2836
Run duration 08m 05s
Commit git commit 2f31c145a1 ℹ️: Merge da30645c8d4216d4bc17948cd8e72da1f0736b95 into 8a0c32124fb0ca5cfde700c1c128...
Committer pointhalo
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 11
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 264
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

@YyumeiZhang YyumeiZhang merged commit f79576d into main Sep 20, 2024
10 checks passed
@YyumeiZhang YyumeiZhang deleted the fix-1530 branch September 20, 2024 06:50
Copy link

cypress bot commented Sep 20, 2024

semi-design    Run #2839

Run Properties:  status check passed Passed #2839  •  git commit f79576d9ce: fix: autoComplete can't scroll when keyboard up and down, #1530 (#2501)
Project semi-design
Branch Review main
Run status status check passed Passed #2839
Run duration 08m 13s
Commit git commit f79576d9ce: fix: autoComplete can't scroll when keyboard up and down, #1530 (#2501)
Committer pointhalo
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 11
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 264
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants