Skip to content

fix: keep measurement textarea out of tab order - #200

Open
nrps9909 wants to merge 1 commit into
react-component:masterfrom
nrps9909:codex/hidden-textarea-tabindex
Open

fix: keep measurement textarea out of tab order#200
nrps9909 wants to merge 1 commit into
react-component:masterfrom
nrps9909:codex/hidden-textarea-tabindex

Conversation

@nrps9909

@nrps9909 nrps9909 commented Aug 27, 2026

Copy link
Copy Markdown

Summary

  • replace the invalid tab-index attribute on the autosize measurement textarea with the standard tabindex
  • add a regression that verifies tabindex="-1" is present and the misspelled attribute is absent

Browsers ignore tab-index, so the intended keyboard safeguard was not applied. This is the rc-input counterpart of react-component/textarea#80 and its open fix #81; rc-input is a separately published package with the same copied measurement implementation and currently has no corresponding issue or PR.

Verification

  • Exact-base regression: 127 passed, 1 failed because tabindex was missing
  • Fixed full suite: 10 suites, 128 tests, 22 snapshots passed
  • npm run tsc
  • npm run lint — 0 errors, 2 pre-existing Hook dependency warnings
  • npm run compile — ESM, CJS, declarations, and Less compilation passed
  • focused Prettier check and git diff --check

I checked every current open rc-input PR changed file and found no overlap with src/calculateNodeHeight.tsx.

AI assistance disclosure: Codex was used to confirm the duplicated invalid attribute in the separately published rc-input package, audit open work, add the regression, and run verification. The exact-base failure and one-token source correction were reviewed locally.

Summary by CodeRabbit

  • Bug 修复

    • 修正自动调整高度模式下隐藏测量文本框的键盘焦点行为,使其不会进入 Tab 键导航顺序。
  • 测试

    • 新增测试,确保隐藏文本框使用正确的 tabindex="-1" 属性。
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

@nrps9909 is attempting to deploy a commit to the afc163's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7cd6f116-2fb8-44ec-bfa1-7a146bd6b48e

📥 Commits

Reviewing files that changed from the base of the PR and between 52086bb and 8f32d12.

📒 Files selected for processing (2)
  • src/calculateNodeHeight.tsx
  • tests/TextArea.test.tsx

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

隐藏测量 textarea 现在使用有效的 tabindex="-1" 属性。测试验证该属性存在,并确认无效的 tab-index 属性不存在。

Changes

隐藏 textarea 的 Tab 顺序修正

Layer / File(s) Summary
修正属性并添加验证
src/calculateNodeHeight.tsx, tests/TextArea.test.tsx
隐藏测量 textarea 使用 tabindex="-1"。新增 autoSize 测试,验证正确属性存在且 tab-index 不存在。

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 8f32d

The change restores the hidden measurement textarea’s intended exclusion from keyboard tab order and adds regression coverage; no actionable merge-blocking risk remains after normal checks and review.

Poem

小兔发现属性排错队,
tab-index 换成 tabindex
隐藏文本框安静退场,
Tab 键顺畅跳过身旁。
测试点头,耳朵轻扬。

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning PR 将测量 textarea 的 tabindex 修正作为主要变更,但直接关联的 issue #81 要求修复禁用输入框按 Enter 时的错误。当前变更未实现组合事件、按键管理、禁用状态处理或重复输入事件防止逻辑。 请实现 issue #81 的编码要求,或移除该 issue 的直接关联并关联与 tabindex 修复相关的 issue。
Out of Scope Changes check ⚠️ Warning 相对于直接关联的 issue #81tabindex 属性修复和对应测试属于无关变更。它们没有处理禁用输入框按 Enter 时的错误。 请将 tabindex 修复拆分到独立 PR,或更新关联 issue,使其明确包含测量 textarea 的 Tab 顺序要求。
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了主要变更,即使测量 textarea 不参与 Tab 键顺序。
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant