-
Notifications
You must be signed in to change notification settings - Fork 269
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
perf: input #2978
base: feat_v3.x
Are you sure you want to change the base?
perf: input #2978
Conversation
Walkthrough本次 PR 修改了两个 Input 组件文件。在 src/.../input.taro.tsx 中,添加了 BaseEventOrig 导入,简化了 updateValue 函数逻辑,并调整了 handleInput 事件处理方式,同时将内联样式替换为调用 getTextAlign 函数。在 src/.../input.tsx 中,对导入顺序进行整理,更新了事件及接口类型,重命名并简化了多个函数(如 updateValue → handleValueUpdate、inputClass → getInputClass、inputType → getInputType、handleInput → handleInputChange),并优化了 useImperativeHandle 的实现和清除图标的渲染逻辑。 Changes
Sequence Diagram(s)sequenceDiagram
participant U as 用户
participant IC as Input组件
participant EH as 事件处理器
U->>IC: 触发输入事件
IC->>IC: 提取事件值 (detail/currentTarget)
alt 非 onChange 触发
IC->>EH: 调用事件处理器 (eventHandler?.(val))
end
EH-->>IC: 返回处理结果
IC->>IC: 更新组件状态
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used🪛 GitHub Check: codecov/patchsrc/packages/input/input.tsx[warning] 119-120: src/packages/input/input.tsx#L119-L120 [warning] 224-224: src/packages/input/input.tsx#L224 ⏰ Context from checks skipped due to timeout of 90000ms (1)
🔇 Additional comments (8)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat_v3.x #2978 +/- ##
=============================================
+ Coverage 85.74% 85.76% +0.02%
=============================================
Files 277 277
Lines 18105 18069 -36
Branches 2745 2738 -7
=============================================
- Hits 15524 15497 -27
+ Misses 2576 2567 -9
Partials 5 5 ☔ View full report in Codecov by Sentry. |
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
重构
样式更新