Skip to content

Commit 98dc410

Browse files
committed
fix: regex 문제 수정
1 parent eefc462 commit 98dc410

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/shop/src/components/common/customer_info_form_dialog.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ import * as React from "react";
1515
import ShopHooks from "../../hooks";
1616
import ShopSchemas from "../../schemas";
1717

18-
const PHONE_REGEX = new RegExp(/^(010-\d{4}-\d{4}|(\+82|0)10\d{3,4}\d{4})$/, "g").source;
19-
2018
type CustomerInfoFormDialogPropsType = {
2119
open: boolean;
2220
closeFunc: () => void;
@@ -80,7 +78,12 @@ export const CustomerInfoFormDialog: React.FC<CustomerInfoFormDialogPropsType> =
8078
name="phone"
8179
label={phoneLabelStr}
8280
defaultValue={defaultValue?.phone}
83-
slotProps={{ htmlInput: { pattern: PHONE_REGEX, title: phoneValidationFailedStr } }}
81+
slotProps={{
82+
htmlInput: {
83+
pattern: new RegExp(/^(010-\d{4}-\d{4}|(\+82)10\d{7,8})$/, "i").source,
84+
title: phoneValidationFailedStr,
85+
},
86+
}}
8487
fullWidth
8588
required
8689
/>

0 commit comments

Comments
 (0)