Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix number input type for values over 1000 #2163

Merged
merged 8 commits into from
Feb 21, 2024
Merged

Conversation

mvorisek
Copy link
Member

@mvorisek mvorisek commented Feb 7, 2024

UI numeric values/types are rendered using UI persistence and can contain non-numeric characters like space, comma.

repro

Currently, such correctly formatted UI values, are considered as bad, example:

image

can be reproduced on demos/form-control/multiline.php demo by writing 1 000 in "Qty" number input.

solution

The visual style is controlled by https://developer.mozilla.org/en-US/docs/Web/CSS/:invalid CSS presudo class which is set by https://developer.mozilla.org/en-US/docs/Web/HTML/Constraint_validation . In short, input type=number cannot be used for anything else than \d+ value, thus we need to set type to be different than number or do not set it at all.

@mvorisek mvorisek force-pushed the input_number_with_space branch from 06f140e to 4da2d4b Compare February 20, 2024 13:48
@mvorisek mvorisek force-pushed the input_number_with_space branch from 4da2d4b to a3f39b7 Compare February 21, 2024 11:31
@mvorisek mvorisek force-pushed the input_number_with_space branch from a3f39b7 to 9e65828 Compare February 21, 2024 13:10
@mvorisek mvorisek marked this pull request as ready for review February 21, 2024 13:25
@mvorisek mvorisek merged commit a513757 into develop Feb 21, 2024
49 checks passed
@mvorisek mvorisek deleted the input_number_with_space branch February 21, 2024 13:34
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.

1 participant