Fix positive float number input validation (#1233)
* Fix positive float number validation * Update changelog
This commit is contained in:
parent
ecb7c69c59
commit
58b9634f75
2 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue