Skip to content

feat(ui5-number-input): introduce NumberInput component - #13799

Open
GDamyanov wants to merge 34 commits into
mainfrom
number-input
Open

feat(ui5-number-input): introduce NumberInput component#13799
GDamyanov wants to merge 34 commits into
mainfrom
number-input

Conversation

@GDamyanov

@GDamyanov GDamyanov commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Introduces a new ui5-number-input component as the dedicated numeric input primitive, and refactors ui5-step-input to be built on top of it.

New Component: ui5-number-input

A numeric input field ui5-number-input has been extracted as a standalone component. It handles all numeric input logic internally:

  • Number formatting via locale-aware NumberFormat
  • Min/max validation with value-state-change event (preventable)
  • Keyboard navigation: arrow keys, Ctrl/Shift modifiers, Page Up/Down
  • Mouse wheel support
  • Spin button acceleration on long-press
  • Increment/decrement buttons (opt-in via _showStepButtons)
  • Form association support
  • Full accessibility (ARIA labels, value state messages)

Refactored: ui5-step-input

ui5-step-input is now a thin wrapper around ui5-number-input, delegating all numeric logic to it

A new private property is added in the ui5-number-input:

_showStepButtons is a @Private, noAttribute boolean property on ui5-number-input (defaults to false) that controls whether the increment/decrement buttons are rendered. When false, ui5-number-input renders as a plain numeric input with no step buttons — suitable for standalone use. ui5-step-input sets _showStepButtons={true} in its template, which activates the buttons and the associated CSS modifier class (ui5-number-input-root--with-buttons). This means the step button UI lives entirely inside ui5-number-input; ui5-step-input does not render any buttons of its own.

Breaking Changes

BREAKING CHANGE: ui5-step-input shadow DOM internals changed

ui5-step-input now composes ui5-number-input internally instead of ui5-input.
Any CSS, querySelector, or ::part() targeting the previous inner [ui5-input]
(.ui5-step-input-root, .ui5-step-input-input) will no longer work and must be edited

@GDamyanov GDamyanov self-assigned this Jul 8, 2026
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 8, 2026 11:29 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

👋 Heads-up: dev close is in effect

Thanks for the contribution! This repository is currently in dev close ahead of release next (scheduled 2026-07-09, UTC). See the release schedule for the full timeline.

This PR appears to introduce public-API changes (detected by diffing the Custom Elements Manifest against the latest published version on npm):

@ui5/webcomponents

  • ➕ added element: NumberInput
  • ➕ added property: accessibleName
  • ➕ added property: accessibleNameRef
  • ➕ added property: disabled
  • ➕ added property: max
  • ➕ added property: min
  • ➕ added property: name
  • ➕ added property: placeholder
  • ➕ added property: readonly
  • ➕ added property: required
  • ➕ added property: step
  • ➕ added property: value
  • ➕ added property: valuePrecision
  • ➕ added property: valueState
  • ➕ added event: change
  • ➕ added event: input
  • ➕ added event: value-state-change
  • ➕ added slot: valueStateMessage
  • ➕ added attribute: accessible-name
  • ➕ added attribute: accessible-name-ref
  • ➕ added attribute: disabled
  • ➕ added attribute: max
  • ➕ added attribute: min
  • ➕ added attribute: name
  • ➕ added attribute: placeholder
  • ➕ added attribute: readonly
  • ➕ added attribute: required
  • ➕ added attribute: step
  • ➕ added attribute: value
  • ➕ added attribute: value-precision
  • ➕ added attribute: value-state
  • 🔄 changed attribute value-state (type)

Could you please hold off on merging into main until the release ships? Public-API changes are best landed in the next dev cycle so they don't slip into the release at the last minute. Once the release is out, this PR is good to go.

If this change must ship in the current release, please request a review from one or two members of @UI5/ui5-team-webc so the team can sign off explicitly.

💬 False positive? If you believe this PR doesn't actually change the public API (e.g. only internal refactoring, or an entry the detector mis-attributed), please reply on this thread — your feedback helps us improve the detection during this trial run.

Posted automatically by the Dev Close Notice workflow.

@sap-ui5-webcomponents-release

Copy link
Copy Markdown

@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 8, 2026 11:40 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 8, 2026 11:44 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 8, 2026 12:04 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 8, 2026 12:36 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 8, 2026 12:39 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 8, 2026 13:40 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 8, 2026 14:05 — with GitHub Actions Inactive
@GDamyanov
GDamyanov requested a review from hinzzx July 8, 2026 14:26
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 9, 2026 14:16 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 9, 2026 19:39 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 10, 2026 06:21 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 10, 2026 06:49 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 20, 2026 07:28 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 20, 2026 08:08 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 20, 2026 08:21 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 20, 2026 09:04 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 20, 2026 09:08 — with GitHub Actions Inactive
@GDamyanov
GDamyanov requested a review from hinzzx July 20, 2026 11:45
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 20, 2026 16:13 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 20, 2026 16:23 — with GitHub Actions Inactive
Comment thread packages/main/src/NumberInput.ts Outdated
}

get _displayValue() {
if (this._languageChanged) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getters invoked from templates should be pure, so i think we have to move this flag reset out of the getter (e.g. into onBeforeRendering or the language handler).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in edef75d

value = this._preciseValue(value);
if (value !== this.value) {
this.value = value;
this._inputValue = this._formatNumber(value);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the _inputValue is never set back to undefined

the template renders value={this._inputValue ?? this._displayValue}

The language-change handler resets the formatter/delimiters and sets _languageChanged = true, but does not clear _inputValue. So once the user has interacted, switching locale will not re-format the displayed number (e.g. 1,234.50 won't become 1.234,50).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in edef75d

@nnaydenow

Copy link
Copy Markdown
Contributor

Please add it to FormSupport related pages and tests. Don't forget to put new badge in the documentation page.

@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 27, 2026 19:23 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 27, 2026 19:49 — with GitHub Actions Inactive
@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 27, 2026 19:56 — with GitHub Actions Inactive
@GDamyanov

Copy link
Copy Markdown
Contributor Author

Please add it to FormSupport related pages and tests. Don't forget to put new badge in the documentation page.

Fixed in 03306d9

@GDamyanov
GDamyanov temporarily deployed to netlify-preview July 27, 2026 20:00 — with GitHub Actions Inactive
@GDamyanov
GDamyanov requested a review from hinzzx July 29, 2026 06:44
@GDamyanov
GDamyanov requested a review from LilyanaOviPe August 20, 2026 12:38
@GDamyanov
GDamyanov deployed to netlify-preview August 20, 2026 12:44 — with GitHub Actions Active
<ValuePrecision />

### States
NumberInput supports several semantic value states, readonly, disabled, etc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NumberInput supports several semantic value states, readonly, disabled, etc.
The `ui5-number-input` component supports several semantic value states, read-only mode, and disabled mode.

/**
* Fired when the value of the component changes at each keystroke.
* @public
* @since 2.6.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this stay as it is or change to since 2.24.0?

* Fired before the value state of the component is updated internally.
* The event is preventable, meaning that if it's default action is
* prevented, the component will not update the value state.
* @since 1.23.0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this stay as it is or change to @SInCE 2.24.0?

* Receives id(or many ids) of the elements that label the component.
* @default undefined
* @public
* @since 1.0.0-rc.15

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this stay as it is or change to since 2.24.0?

*
* ### Overview
*
* The `ui5-number-input` is a numeric input field. It allows users to enter, edit, and select numeric values.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* The `ui5-number-input` is a numeric input field. It allows users to enter, edit, and select numeric values.
* The `ui5-number-input` component is a numeric input field. It allows users to enter, edit and select numeric values.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it actually allow users to select values or just enter and edit?

Comment on lines +123 to +125
* Fired before the value state of the component is updated internally.
* The event is preventable, meaning that if it's default action is
* prevented, the component will not update the value state.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Fired before the value state of the component is updated internally.
* The event is preventable, meaning that if it's default action is
* prevented, the component will not update the value state.
* Fired before the value state of the component is updated internally.
* The event is preventable, meaning that if its default action is
* prevented, the component will not update the value state.

*
* The default step is 1 but the app developer can set a different one.
*
* App developers can set a maximum and minimum value for the `NumberInput`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* App developers can set a maximum and minimum value for the `NumberInput`.
* App developers can set a maximum and minimum value for `ui5-number-input`.

accessibleName?: string;

/**
* Receives id(or many ids) of the elements that label the component.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Receives id(or many ids) of the elements that label the component.
* Receives ID (or many IDs) of the elements that label the component.

* Defines the accessible ARIA name of the component.
* @default undefined
* @public
* @since 1.0.0-rc.15

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct or should it be 2.24.0?

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.

4 participants