Uh oh!
There was an error while loading. Please reload this page.
fix: render numeric zero input affixes - #201
Conversation
@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. |
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 (3)
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 localized change makes numeric zero render correctly in existing input decoration slots while preserving null and false cleanup behavior. No actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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
0values inprefix,suffix,addonBefore, andaddonAfterWhy
These four public props accept ReactNode, and React renders numeric zero. The shared
hasPrefixSuffix/hasAddonhelpers and the corresponding render conditions currently rely on truthiness, so passing0removes both the content and the structural wrapper needed for its styles.On exact base
52086bb9f34b03abcb3822f971b180bd5a90e79a, the new regression failed because the prefix query returned null. It passes after the fix, and the null / false rerender still removes both wrapper layers.Validation
rc-test --no-watchman --runInBand— 10 suites, 128 tests, 22 snapshotstsc --noEmitResizableTextArea.tsxhook warningsgit diff --checkOverlap audit
The only current open PR touching
src/BaseInput.tsxis the unrelated copy-feature proposal #40 from 2021. It does not changehasPrefixSuffix,hasAddon, or any of the four conditions in this fix. I found no open issue or PR targeting numeric-zero affix or addon content.AI assistance disclosure: Codex was used to audit open overlap, trace the duplicated truthiness checks, draft the regression and minimal shared predicate, and run the validation listed above. The exact-base failure and fixed behavior were verified locally.
Summary by CodeRabbit
0作为前缀、后缀或附加内容的问题。0的渲染,以及内容设为null或false时相关元素的隐藏。