Skip to content

Conversation

@xiaoxiyao
Copy link
Contributor

@xiaoxiyao xiaoxiyao commented Dec 26, 2025

这个 PR 做了什么? (简要描述所做更改)

修复按钮组件disabled属性设为false时没有自动移除的问题(使用属性反射:https://stenciljs.com/docs/properties#reflect-properties-values-to-attributes-reflect)

这个 PR 是什么类型? (至少选择一个)

  • 错误修复 (Bugfix) issue: fix #
  • 新功能 (Feature)
  • 代码重构 (Refactor)
  • TypeScript 类型定义修改 (Types)
  • 文档修改 (Docs)
  • 代码风格更新 (Code style update)
  • 构建优化 (Chore)
  • 其他,请描述 (Other, please describe):

这个 PR 涉及以下平台:

  • 所有平台
  • Web 端(H5)
  • 移动端(React-Native)
  • 鸿蒙(Harmony)
  • 鸿蒙容器(Harmony Hybrid)
  • ASCF 元服务
  • 快应用(QuickApp)
  • 所有小程序
  • 微信小程序
  • 企业微信小程序
  • 京东小程序
  • 百度小程序
  • 支付宝小程序
  • 支付宝 IOT 小程序
  • 钉钉小程序
  • QQ 小程序
  • 飞书小程序
  • 快手小程序
  • 头条小程序

Summary by CodeRabbit

发布说明

  • 重构
    • 调整了 Button 组件中 disabled 属性的声明与在 DOM 中的呈现(移除了宿主元素上的 disabled 属性反射),改动仅涉及属性声明与渲染标记处理。无功能或事件行为变化。

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 26, 2025

Walkthrough

将 Button 组件的 disabled 属性改为带有属性反射的声明 (@Prop({ reflect: true })),并从组件根 Host 元素上移除对 disabled 属性的直接传播(删除了 disabled={disabled})。

Changes

Cohort / File(s) 变更摘要
Button 组件属性更新
packages/taro-components/src/components/button/button.tsx
将属性声明从 @Prop() disabled: boolean 修改为 @Prop({ reflect: true }) disabled: boolean;从 Host 元素移除 disabled={disabled} 属性传播(仅变更装饰器与 Host 属性绑定)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 分钟

建议审查者

  • tutuxxx

🐰 轻敲键盘细自省,
属性反射悄然生,
Host 轻装少一笔,
小改动里藏清明,
兔子跳跃把喜呈 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题清晰地反映了PR的主要变化:修复按钮组件disabled属性设为false时未自动移除的问题。变更内容完全与标题相符。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c47c75c and 9f7472b.

📒 Files selected for processing (1)
  • packages/taro-components/src/components/button/button.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/taro-components/src/components/button/button.tsx

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e186a3 and c47c75c.

📒 Files selected for processing (1)
  • packages/taro-components/src/components/button/button.tsx

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.32%. Comparing base (60be41b) to head (9f7472b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #18700   +/-   ##
=======================================
  Coverage   56.32%   56.32%           
=======================================
  Files         447      447           
  Lines       23345    23345           
  Branches     5777     5755   -22     
=======================================
  Hits        13149    13149           
- Misses       8368     8369    +1     
+ Partials     1828     1827    -1     
Flag Coverage Δ
taro-cli 72.85% <ø> (ø)
taro-runtime 60.27% <ø> (ø)
taro-web 53.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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