limite de qty pour qtyselect pour pas ralentir avec des très grand nombres.

This commit is contained in:
Victor Turgeon
2022-11-08 00:58:55 -05:00
parent 30d3c520ac
commit 5cbf9e4137
6 changed files with 1456 additions and 19 deletions

View File

@@ -3,7 +3,7 @@ import { Form } from "react-bootstrap";
const QtySelect = ({onChange, qty }) => {
return (
<Form.Select onChange={(e)=>onChange(e.target.value)} className="qty-select">
{Array.from(Array(qty), (e, i) => {
{Array.from(Array(qty <= 99 ? qty : 99), (e, i) => {
return (
<option value={i+1} key={i+1}>{i+1}</option>
)