From 24e52938c00f91ac8a426ff1d2860ded2de16044 Mon Sep 17 00:00:00 2001 From: "oura.a" Date: Wed, 5 Jul 2023 02:07:52 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20PR=20206:=20=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=82=BB=E3=83=B3=E3=82=B9=E6=95=B0=E5=85=A5=E5=8A=9B=E3=81=AE?= =?UTF-8?q?=E3=83=86=E3=82=AD=E3=82=B9=E3=83=88=E3=83=9C=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=B9=E3=81=AB=E3=80=8C.=E3=80=8D=E3=80=8C+=E3=80=8D?= =?UTF-8?q?=E3=80=8C-=E3=80=8D=E3=81=8C=E5=85=A5=E5=8A=9B=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E4=BB=B6=E3=81=AE?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task2104: ライセンス数入力のテキストボックスに「.」「+」「-」が入力できてしまう件の修正](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/2104) replaceで消そうと思っていたのですが、うまくいかなかったため、 「+」「-」「.」のキー入力を取り消す方法で実装しました。 ## レビューポイント なし ## UIの変更 なし ## 動作確認状況 ローカルで確認 ## 補足 なし --- .../src/pages/LicensePage/cardLicenseIssuePopup.tsx | 4 +++- dictation_client/src/pages/LicensePage/licenseOrderPopup.tsx | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dictation_client/src/pages/LicensePage/cardLicenseIssuePopup.tsx b/dictation_client/src/pages/LicensePage/cardLicenseIssuePopup.tsx index 6b972f6..e700d01 100644 --- a/dictation_client/src/pages/LicensePage/cardLicenseIssuePopup.tsx +++ b/dictation_client/src/pages/LicensePage/cardLicenseIssuePopup.tsx @@ -107,7 +107,9 @@ export const CardLicenseIssuePopup: React.FC = ( step={1} className={styles.formInput} onChange={(e) => { - const input = Number(e.target.value.substring(0, 4)); + const input = Number( + e.target.value.replace(/[-.]/g, "").substring(0, 4) + ); setCount(input); }} onBlur={(e) => { diff --git a/dictation_client/src/pages/LicensePage/licenseOrderPopup.tsx b/dictation_client/src/pages/LicensePage/licenseOrderPopup.tsx index 2590176..8d46a79 100644 --- a/dictation_client/src/pages/LicensePage/licenseOrderPopup.tsx +++ b/dictation_client/src/pages/LicensePage/licenseOrderPopup.tsx @@ -177,7 +177,9 @@ export const LicenseOrderPopup: React.FC = (props) => { maxLength={4} className={styles.formInput} onChange={(e) => { - const input = Number(e.target.value.substring(0, 4)); + const input = Number( + e.target.value.replace(/[-.]/g, "").substring(0, 4) + ); setCount(input); }} onBlur={(e) => {