Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Change Proposal: Increment/Decrement Spinner Buttons for `NumberInput`

未关闭
#273 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 7 天内回复

@zoharma 已经在做这个了。

开始于 2026年8月5日。

  • #271 来自 @zoharma —— 未关闭

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
typescript
领域
frontend

调研方向

先检查现有的 NumberInput 组件及其当前的 numberMode、minValue 和 maxValue 行为,然后查看开放的 pull request #271,以了解已经在进行的工作。当可选的 spinner 按钮支持所提议的步长和可见性设置、将值限制在边界范围内,并且不影响现有用法时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

accepted

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.

Image

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: NumberInput can now render a vertical up/down ButtonGroup inside the field as an end adornment. Clicking increases/decreases the current value by step, clamped to minValue/maxValue. Buttons disable automatically at the limits.

  • New props:

    • step?: number: the increment/decrement amount, defaults to 1.
    • 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

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

DiamondLightSource/sci-react-ui 的其他 Issue

查看 DiamondLightSource/sci-react-ui 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。