From ee33a0a82a6f9bf1e592b6567c63dc5e8d032b80 Mon Sep 17 00:00:00 2001 From: "Yuna.Suzuki" Date: Mon, 16 Jun 2025 16:36:41 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=9D=E3=82=82=E3=81=9D=E3=82=82"-"?= =?UTF-8?q?=E3=82=92=E5=85=A5=E5=8A=9B=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/StockPage.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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(); + } + }} + /> {/* 購入日・消費期限を横並びに */}