Skip to content

Conversation

@pskelin
Copy link
Contributor

@pskelin pskelin commented Feb 24, 2025

<ui5-input> has a very complex logic for handling type=numeric, implemented by keeping _innerValue.

This has two issues:

  1. a patch is necessary in preact to render a value in the DOM only when it is different from the old value.
  2. this prevents forcing an old value on the input in case an event handler decides not to accept new state

This fix remove the preact patch returning it to default - if a value is set in the tempate, it will be set in the DOM (for native inputs this will always assign a value from the state, even if it is the same)

By removing the _innverValue, apps can automatically set an old value and it will propagate in the DOM.

Example before - an input that accepts only three numbers by setting the old value if more than three numbers arrive

type `123` -> input value is `123`
type `1234` -> input value prop is `123` but input value in dom is `1234`

Example after - when setting an old value, it will be updated in the inner input, so typing 1234 will correctly result in 123 both in .value property and in DOM.

see Input_old_value.html for example code

@github-actions github-actions bot added the Stale label Mar 26, 2025
@github-actions github-actions bot removed the Stale label Mar 27, 2025
@github-actions github-actions bot added the Stale label May 20, 2025
@github-actions github-actions bot closed this May 28, 2025
@pskelin pskelin reopened this Oct 27, 2025
@ui5-webcomponents-bot
Copy link
Collaborator

ui5-webcomponents-bot commented Oct 27, 2025

@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 27, 2025 08:56 Inactive
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview October 27, 2025 08:56 Inactive
@pskelin pskelin reopened this Jan 5, 2026
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview January 5, 2026 07:19 Inactive
@github-actions github-actions bot removed the Stale label Jan 6, 2026
@ui5-webcomponents-bot ui5-webcomponents-bot temporarily deployed to preview January 6, 2026 08:16 Inactive
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.

3 participants