You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(range): keep rounded release values within current bounds - #3612
Range clamps before step rounding. With min0/max100/step40, drag to80, change max to60, and release. Rounding the capped60 produces80, so onEnd exceeds the current maximum.
Clamp the final rounded result in both H5 and Taro. No new props or dependencies. Added an H5 touch regression.
Focused check ran the actual format, updateValue, and onTouchEnd closures from each platform with the actual overlap/equality helpers. Hook memoization/state access was supplied by the fixture; the full React/Taro rendering tree was not mounted.
Platform
Before at max60/step40
After
H5
onEnd(80)
onEnd(60)
Taro
onEnd(80)
onEnd(60)
The package Vitest suite, builds, and type checks were not run. No package installation. The callback calculation changes; there are no stylesheet or DOM changes to screenshot.
Prepared with AI assistance and reviewed against the source.
☑️ 核心质量与合并自查清单 (Quality Checklist)
⚠️请在提交前逐项核对并勾选以下自查项:
1. 📐 等比缩放规范 (Proportional Scaling)
组件 SCSS 源码(src/packages/*/*.scss)直接书写标准设计稿裸 px(构建和 dev 环境会自动转为 scale-px,源码中未手动硬编码 scale-px)
This change keeps the Range value passed to onEnd within the current min and max after step rounding, on both H5 and Taro. The change is small and localized, and no merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
标题“fix(range): keep rounded release values within current bounds”描述了本 PR 的主要变更:Range 在 step 四舍五入后,将释放时的值限制在当前 min 与 max 范围内。变更摘要显示 format 先限制范围、再四舍五入、最后再次限制范围,与标题一致。标题使用 Conventional Commits 格式,具体且可读。
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 这个变动的性质是?
🔗 相关 Issue
Standalone bug fix; reproduction below.
💡 需求背景和解决方案
Range clamps before step rounding. With min0/max100/step40, drag to80, change max to60, and release. Rounding the capped60 produces80, so
onEndexceeds the current maximum.Clamp the final rounded result in both H5 and Taro. No new props or dependencies. Added an H5 touch regression.
Focused check ran the actual
format,updateValue, andonTouchEndclosures from each platform with the actual overlap/equality helpers. Hook memoization/state access was supplied by the fixture; the full React/Taro rendering tree was not mounted.onEnd(80)onEnd(60)onEnd(80)onEnd(60)The package Vitest suite, builds, and type checks were not run. No package installation. The callback calculation changes; there are no stylesheet or DOM changes to screenshot.
Prepared with AI assistance and reviewed against the source.
☑️ 核心质量与合并自查清单 (Quality Checklist)
1. 📐 等比缩放规范 (Proportional Scaling)
src/packages/*/*.scss)直接书写标准设计稿裸px(构建和 dev 环境会自动转为scale-px,源码中未手动硬编码scale-px)0(未写scale-px(0px))border、outline上≤ 1px如 1px、0.5px)保持物理像素,未被错误放大src/styles/variables*.scss中的变量兜底值,已显式声明scale-px();字号/图标专用场景使用了scale-font-px/scale-icon-px2. 🛡️ 向前兼容性 (Backward Compatibility)
--nutui-*)@deprecated并提供兼容桥接(旧写法仍能正常运行)3. 🧩 属性抽象与双端一致 (Prop Design & Consistency)
types.ts),双端功能行为一致4. 📦 包体大小与依赖控制 (Bundle Size)
src/utils内部轻量工具5. ✨ 使用易用性与文档 (Developer Experience)
demos/补齐对应的高频使用场景演示(基础用法、受控用法等)doc.md、doc.taro.md等)已同步更新6. ⚙️ 自动化检查 (QA)
npm run checked && npm run checked:taro双端类型检查零报错npx vitest run src/packages/[component])package-lock.json等无关改动Summary by CodeRabbit