Skip to content

Conversation

@wanpan11
Copy link
Contributor

@wanpan11 wanpan11 commented Feb 26, 2025

禁止 clearIcon tab 聚焦

Summary by CodeRabbit

  • New Features
    • 调整了输入框中清除图标按钮的行为:该按钮现在不会通过键盘导航获得焦点,从而改变了交互体验。

@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2025

Walkthrough

此次 PR 对两个组件进行了修改。
BaseInput 中,为清除按钮新增了 tabIndex={-1} 属性,从而使按钮不可通过键盘导航获得焦点。
Input 中,更新了 useMergedStateomit 的导入路径,但不改变其功能逻辑。
测试文件中,部分测试用例被注释掉,且更新了测试中 spyElementPrototypes 的导入路径。

Changes

文件路径 更改内容
src/BaseInput.tsx 在清除按钮上新增 tabIndex={-1} 属性,修改键盘焦点行为,保留原有事件处理逻辑。
src/Input.tsx 更新 useMergedStateomit 模块的导入路径,不影响组件逻辑。
tests/BaseInput.test.tsx 注释掉两个用户交互的测试用例,保留测试结构但不再执行。
tests/focus.test.tsx 更新 spyElementPrototypes 的导入路径,不影响测试逻辑。
tests/index.test.tsx 更新 spyElementPrototypes 的导入路径,不影响测试逻辑。

Possibly related PRs

Suggested reviewers

  • afc163

Poem

我是一只快乐的小兔子 🐰,
跳跃在代码的原野上,
清除按钮静默无焦点,
新路径指引未来方向,
让我们在代码中欢快起舞!
🥕🌸🐇

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

tests/BaseInput.test.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct.

The config "prettier" was referenced from the config file in "/.eslintrc.js".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

tests/focus.test.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct.

The config "prettier" was referenced from the config file in "/.eslintrc.js".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

tests/index.test.tsx

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct.

The config "prettier" was referenced from the config file in "/.eslintrc.js".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 950c11b and bd02998.

⛔ Files ignored due to path filters (1)
  • tests/__snapshots__/index.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • tests/BaseInput.test.tsx (1 hunks)
  • tests/focus.test.tsx (1 hunks)
  • tests/index.test.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • tests/focus.test.tsx
  • tests/index.test.tsx
  • tests/BaseInput.test.tsx

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@afc163
Copy link
Member

afc163 commented Feb 26, 2025

还有几个 issue 也关联上。

@wanpan11 wanpan11 requested a review from afc163 February 26, 2025 08:14
@codecov
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.66%. Comparing base (12f3c87) to head (bd02998).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #111   +/-   ##
=======================================
  Coverage   97.66%   97.66%           
=======================================
  Files           4        4           
  Lines         214      214           
  Branches       78       80    +2     
=======================================
  Hits          209      209           
  Misses          5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@afc163 afc163 merged commit f74e861 into react-component:master Feb 26, 2025
7 checks passed
@wanpan11 wanpan11 deleted the fix-tabindex branch February 26, 2025 08:43
afc163 pushed a commit that referenced this pull request Apr 11, 2025
afc163 pushed a commit that referenced this pull request Apr 11, 2025
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