This commit is contained in:
@@ -15,7 +15,9 @@ const InputPrice = (props) => {
|
||||
const handleChange = (e) => {
|
||||
// console.log(`Preis: ${e.target.value}`);
|
||||
// console.log('RegEx: ', isValidPrice(e.target.value));
|
||||
setPrice(e.target.value);
|
||||
let value = Number(e.target.value);
|
||||
|
||||
setPrice(value);
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -29,10 +31,11 @@ const InputPrice = (props) => {
|
||||
<input
|
||||
type="number"
|
||||
name="price"
|
||||
placeholder="0.00"
|
||||
placeholder={0.0}
|
||||
aria-label="Price"
|
||||
className={`form-control input-price ${!isValidPrice(price) ? 'is-invalid' : 'is-valid'}`}
|
||||
step="0.01"
|
||||
className={`form-control input-price
|
||||
${!isValidPrice(price) ? 'is-invalid' : 'is-valid'}`}
|
||||
step={0.01}
|
||||
value={price}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user