Skip to content

feat: support per-handle disabled for Range slider - #1069

Merged
zombieJ merged 33 commits into
react-component:masterfrom
EmilyyyLiu:feat/disabled-handle-array
May 13, 2026
Merged

feat: support per-handle disabled for Range slider#1069
zombieJ merged 33 commits into
react-component:masterfrom
EmilyyyLiu:feat/disabled-handle-array

Conversation

@EmilyyyLiu

@EmilyyyLiu EmilyyyLiu commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

功能说明

本 PR 新增了 per-handle disabled 功能,允许在 Range 滑块中单独禁用特定的 handle:

  • disabled 支持数组类型,如 [true, false, true] 可禁用第1和第3个 handle
  • 禁用 handle 会作为移动边界,其他 handle 无法越过
  • pushable 配置会考虑禁用的 handle 作为边界
  • 当任意 handle 被禁用时,editable 模式自动禁用
  • 添加了禁用 handle 的视觉样式(灰色边框、not-allowed 光标)

使用示例

<Slider 
  range 
  value={[10, 50, 90]} 
  disabled={[false, true, false]}  // 禁用中间 handle
/>
// 中间 handle (50) 作为边界,第一个 handle 无法超越 50,第三个 handle 无法低于 50

关联 issue

ant-design/ant-design#10143

测试覆盖

  • ✅ 所有现有测试通过
  • ✅ 添加禁用 handle 行为测试
  • ✅ 添加作为边界的测试
  • ✅ 添加 pushable 配合测试

Loading
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