Skip to content

Commit cc9f85d

Browse files
committed
Sync changes with mui-phone-input
1 parent 4c5d6be commit cc9f85d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

development/src/mui-phone/index.tsx

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {InputAdornment, MenuItem, Select, TextField} from "@mui/material";
33

44
import {
55
checkValidity,
6-
cleanInput,
76
displayFormat,
87
getCountry,
98
getDefaultISO2Code,
@@ -142,7 +141,7 @@ const PhoneInput = forwardRef(({
142141
const selectedOption = iso + dial;
143142
if (selectValue === selectedOption) return;
144143
setCountryCode(selectedOption.slice(0, 2));
145-
setValue(displayFormat(cleanInput(mask, mask).join("")));
144+
setValue(getFormattedNumber(mask, mask));
146145
}}
147146
children={<div className="mui-phone-input-select-item">
148147
<div className={`flag ${iso}`}/>
@@ -165,12 +164,12 @@ const PhoneInput = forwardRef(({
165164
InputProps={{
166165
startAdornment: (
167166
<InputAdornment position="start">
168-
<span
167+
<span
169168
style={{cursor: "pointer"}}
170169
onClick={() => setOpen(!open)}
171170
>
172-
<div className={`flag ${countryCode}`}/>
173-
</span>
171+
<div className={`flag ${countryCode}`}/>
172+
</span>
174173
</InputAdornment>
175174
)
176175
}}

0 commit comments

Comments
 (0)