Change Proposal: Increment/Decrement Spinner Buttons for `NumberInput`
维护者通常 7 天内回复
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- typescript
- 领域
- frontend
调研方向
先检查现有的 NumberInput 组件及其当前的 numberMode、minValue 和 maxValue 行为,然后查看开放的 pull request #271,以了解已经在进行的工作。当可选的 spinner 按钮支持所提议的步长和可见性设置、将值限制在边界范围内,并且不影响现有用法时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
What is being proposed?
Add optional up/down spinner buttons to NumberInput so users can nudge a numeric value by a configurable step, instead of only being able to type a value directly.
Why is this needed?
NumberInput currently only accepts typed input. For small, discrete adjustments (e.g. incrementing an integer count), typing is slower and more error-prone than a click-to-step control, which is a common affordance for numeric fields. There was previously no way to adjust the value without full keyboard entry.
What will change?
-
Behaviour:
NumberInputcan now render a vertical up/downButtonGroupinside the field as an end adornment. Clicking increases/decreases the current value by step, clamped tominValue/maxValue. Buttons disable automatically at the limits. -
New props:
step?: number: the increment/decrement amount, defaults to1.spinnerButtons?: "always" | "onHover" | "never": controls spinner visibility. Defaults to"onHover"for all number modes except"scientific", which defaults to"never"(since stepping isn't a natural operation on scientific-notation values).- No new component: this extends the existing
NumberInput.
Interface changes (if any)
Additive/optional only — existing usages of NumberInput are unaffected.
<NumberInput
label="Quantity"
numberMode="natural"
step={1}
spinnerButtons="always" // "always" | "onHover" | "never"
/>
Breaking change?
- Yes
- No
Next steps
A maintainer will review this issue.
If accepted, it will be marked as accepted and a PR may then be opened.
- 主要语言
- TypeScript
- 星标
- 9
- 派生
- 4
- 平均合并
- 7 天 17 小时
- 30 天内合并 PR
- 29
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DiamondLightSource/sci-react-ui 的其他 Issue
-
needs-triage
难度 2/5 1-3 小时 新手友好度 75/100
DiamondLightSource/sci-react-ui#325 · 1 条评论 ·
维护者通常 7 天内回复
-
accepted
难度 2/5 1-3 小时 新手友好度 72/100
DiamondLightSource/sci-react-ui#283 · 1 条评论 ·
维护者通常 7 天内回复
-
Spacing at the top of SidebarNav should be configurable可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭needs-triage
难度 3/5 1-2 天 新手友好度 65/100
DiamondLightSource/sci-react-ui#334 · 1 条评论 ·
维护者通常 7 天内回复
-
needs-triage
难度 5/5 一周以上 新手友好度 38/100
DiamondLightSource/sci-react-ui#332 ·
维护者通常 7 天内回复
-
needs-triage
难度 5/5 一周以上 新手友好度 35/100
DiamondLightSource/sci-react-ui#331 ·
维护者通常 7 天内回复
查看 DiamondLightSource/sci-react-ui 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
needs triage
难度 2/5 1-3 小时 新手友好度 76/100
homarr-labs/homarr#7191 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
AvaProtocol/ava-sdk-js#276 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
apollographql/apollo-client#13493 ·
维护者通常 1 天内回复