diff --git a/frontend/src/pages/StockPage.tsx b/frontend/src/pages/StockPage.tsx index ca18564..76f9352 100644 --- a/frontend/src/pages/StockPage.tsx +++ b/frontend/src/pages/StockPage.tsx @@ -350,6 +350,13 @@ const StockPage: React.FC = () => { type="number" value={editStock.amount} onChange={handleChange} + inputProps={{ min: 0 }} + onKeyDown={(e) => { + if (e.key === '-' || e.key === 'e' || e.key === 'E') { + e.preventDefault(); + } + }} + /> { type="number" value={editStock.price} onChange={handleChange} + inputProps={{ min: 0 }} + onKeyDown={(e) => { + if (e.key === '-' || e.key === 'e' || e.key === 'E') { + e.preventDefault(); + } + }} + /> {/* 購入日・消費期限を横並びに */}