Uh oh!
There was an error while loading. Please reload this page.
fix: resize uncontrolled textarea values - #84
Conversation
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. Walkthrough本次变更使 Changes自动尺寸测量
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk:⚪ Minimal · up to This change makes uncontrolled textarea edits trigger the existing autosize measurement while preserving controlled behavior. No actionable merge-blocking risk remains beyond normal checks and review. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
src/ResizableTextArea.tsxESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. tests/ResizableTextArea.test.tsxESLint skipped: the matched ESLint configuration already failed (missing-dependency). 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. Comment |
Summary
Problem
ResizableTextAreastores uncontrolled edits ininternalValue, but its autosize layout effect depended only on the externalvalueprop. WithdefaultValueor a fully uncontrolled textarea, typing changedmergedValuewhilevalueremainedundefined, sostartResize()was not triggered for the new content.The regression test renders an uncontrolled autosizing textarea, clears the initial measurement call, and changes its DOM value. It receives zero measurement calls on current master and one after this change.
Validation
rc-test --runInBand(6 suites, 54 tests, 9 snapshots)src(no new errors; 2 existing hook warnings in the touched source)git diff --checkExisting repository checks
tsc --noEmitcurrently reports two existing jest-domtoHaveStylematcher type errors in unchangedtests/index.spec.tsxlines 150 and 387.father buildcurrently stops on eight existing restricted internal imports inTextArea.tsx,ResizableTextArea.tsx, andinterface.ts. This change adds no imports.I checked all current open PR changed files and searched open issues/PRs for uncontrolled autosize work. #81 handles hidden-textarea tabindex, #78 handles IME change events, and #49 handles CSP styling; none overlaps this fix.
Summary by CodeRabbit
Bug Fixes
Tests