Merged PR 206: ライセンス数入力のテキストボックスに「.」「+」「-」が入力できてしまう件の修正

## 概要
[Task2104: ライセンス数入力のテキストボックスに「.」「+」「-」が入力できてしまう件の修正](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/2104)

replaceで消そうと思っていたのですが、うまくいかなかったため、
「+」「-」「.」のキー入力を取り消す方法で実装しました。

## レビューポイント
なし

## UIの変更
なし

## 動作確認状況
ローカルで確認

## 補足
なし
This commit is contained in:
oura.a 2023-07-05 02:07:52 +00:00
parent 43a65dbb4e
commit 24e52938c0
2 changed files with 6 additions and 2 deletions

View File

@ -107,7 +107,9 @@ export const CardLicenseIssuePopup: React.FC<CardLicenseIssuePopupProps> = (
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) => {

View File

@ -177,7 +177,9 @@ export const LicenseOrderPopup: React.FC<LicenseOrderPopupProps> = (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) => {