Fix positive float number input validation (#1233)

* Fix positive float number validation

* Update changelog
This commit is contained in:
Dawid Tarasiuk 2021-07-16 12:54:38 +02:00 committed by GitHub
parent ecb7c69c59
commit 58b9634f75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -66,6 +66,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Fix huge payload issue for plugins view - #1203 by @kamilpastuszka
- Fix content type validation in create page view - #1205 by @orzechdev
- Fix list pagination crash on search - #1230 by @orzechdev
- Fix positive float number input validation - #1233 by @orzechdev
# 2.11.1

View file

@ -2,7 +2,7 @@ import { FormChange } from "@saleor/hooks/useForm";
function createNonNegativeValueChangeHandler(change: FormChange) {
return (event: React.ChangeEvent<any>) => {
if (/^\d*(\.\d+)?$/.test(event.target.value)) {
if (/^\d*(\.\d*)?$/.test(event.target.value)) {
change(event);
}
};