Skip to content

fix(alipay): 修复 Slider 属性别名错位导致 min/max/step 失效 (#19483) - #19484

Open
Pulset wants to merge 1 commit into
NervJS:mainfrom
Pulset:fix/slider
Open

fix(alipay): 修复 Slider 属性别名错位导致 min/max/step 失效 (#19483)#19484
Pulset wants to merge 1 commit into
NervJS:mainfrom
Pulset:fix/slider

Conversation

@Pulset

@Pulset Pulset commented Aug 12, 2026

Copy link
Copy Markdown

支付宝原生 slider 不支持 block-size / block-color,编译期 modifySlider 已从模板属性表中删除这两个属性,但运行期未同步删除,导致运行期与编译期 Slider 属性集不一致。getComponentsAlias 据此计算属性别名(p0/p1/...)时 发生错位,min/max/step/value 等属性无法正确传递到原生组件。

运行期同步删除 block-size / block-color,保证两端属性集一致。

这个 PR 做了什么? (简要描述所做更改)
支付宝原生 slider 不支持 block-size / block-color,编译期 modifySlider 已从模板属性表中删除这两个属性,但运行期未同步删除,导致运行期与编译期 Slider 属性集不一致。getComponentsAlias 据此计算属性别名(p0/p1/...)时 发生错位,min/max/step/value 等属性无法正确传递到原生组件。

这个 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

  • Bug 修复
    • 优化支付宝小程序运行时的组件处理,提升组件配置合并后的稳定性。
    • 修复原生 Slider 不支持特定属性导致的兼容性问题,Slider 的使用更加可靠。
  • 兼容性
    • 改善在支付宝平台运行时的组件适配表现,减少因不支持属性引发的异常。

支付宝原生 slider 不支持 block-size / block-color,编译期 modifySlider
已从模板属性表中删除这两个属性,但运行期未同步删除,导致运行期与编译期
Slider 属性集不一致。getComponentsAlias 据此计算属性别名(p0/p1/...)时
发生错位,min/max/step/value 等属性无法正确传递到原生组件。

运行期同步删除 block-size / block-color,保证两端属性集一致。
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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: ca46fd85-94ac-4e49-a05e-24a57b6b4e62

📥 Commits

Reviewing files that changed from the base of the PR and between 30ccf42 and 937bd17.

📒 Files selected for processing (1)
  • packages/taro-platform-alipay/src/runtime.ts

Walkthrough

支付宝运行时保存内部组件合并结果,并移除 Slider 不支持的属性。navigator.userAgent getter 继续优先返回原生值,并在缺失时回退到 swuserAgent 或空字符串。

Changes

支付宝运行时调整

Layer / File(s) Summary
内部组件兼容性处理
packages/taro-platform-alipay/src/runtime.ts
运行时保存 mergeInternalComponents(components) 的结果。存在 Slider 时,删除 block-sizeblock-color 属性。navigator.userAgent 保持原有回退逻辑。

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

我是小兔,轻敲运行时,
Slider 的多余属性悄悄离场。
组件合并结果稳稳保存,
userAgent 仍按旧路回返。
胡萝卜旁,代码更清爽。

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确描述了修复支付宝 Slider 属性别名错位及 min、max、step 失效的问题,与变更目标直接相关。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: dependency version conflict. Check your lock file or package.json.


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.

@Single-Dancer Single-Dancer added this to the 4.2.2 milestone Aug 21, 2026
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.

3 participants