Skip to content

Commit 84cbfac

Browse files
committed
fix: Price TextField 숫자 기준 maxLength 적용하도록 수정
1 parent c90dd30 commit 84cbfac

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/shared/ui/TextField/TextField.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ export const TextField = ({
9292

9393
if (isPrice) {
9494
next = next.replace(/\D/g, '');
95+
if (maxLen !== undefined) {
96+
next = next.slice(0, maxLen);
97+
}
9598
(e.target as HTMLInputElement).value = next;
9699
}
97100

@@ -131,7 +134,7 @@ export const TextField = ({
131134
type="text"
132135
value={displayValue}
133136
disabled={disabled}
134-
maxLength={maxLen}
137+
maxLength={isPrice ? undefined : maxLen}
135138
className={clsx(styles.fieldBase(), styles.input())}
136139
onChange={handleChange}
137140
inputMode={isPrice ? 'numeric' : undefined}

0 commit comments

Comments
 (0)