File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 11{
2- "version" : " 0.3.2 " ,
2+ "version" : " 0.3.3 " ,
33 "name" : " antd-phone-input" ,
44 "description" : " Advanced, highly customizable phone input component for Ant Design." ,
55 "keywords" : [
Original file line number Diff line number Diff line change @@ -215,7 +215,8 @@ const PhoneInput = ({
215215 suffixIcon = { null }
216216 value = { selectValue }
217217 open = { disableDropdown ? false : undefined }
218- onSelect = { ( selectedOption , { key : mask } ) => {
218+ onSelect = { ( selectedOption , { key} ) => {
219+ const [ _ , mask ] = key . split ( "_" ) ;
219220 if ( selectValue === selectedOption ) return ;
220221 const selectedCountryCode = selectedOption . slice ( 0 , 2 ) ;
221222 const formattedNumber = displayFormat ( cleanInput ( mask , mask ) . join ( "" ) ) ;
@@ -241,8 +242,8 @@ const PhoneInput = ({
241242 >
242243 { countriesList . map ( ( [ iso , name , dial , mask ] ) => (
243244 < Select . Option
244- key = { iso + mask }
245245 value = { iso + dial }
246+ key = { `${ iso } _${ mask } ` }
246247 label = { < div className = { `flag ${ iso } ` } /> }
247248 children = { < div className = "ant-phone-input-select-item" >
248249 < div className = { `flag ${ iso } ` } />
You can’t perform that action at this time.
0 commit comments