v5.1.0
Fix
Validation phone (matchIsValidTel
)
- #88 : Excluded country numbers continue to be formatted
What changed ?
Previously, matchIsValidTel
give you true
if your phone number is correct whatever the country. But what if the country of the phone has been excluded to the component?
Example:
import { MuiTelInput } from 'mui-tel-input'
<MuiTelInput excludedCountries={['FR']} />
import { matchIsValidTel } from 'mui-tel-input'
matchIsValidTel('+33626766XXX') // `true` but no, `FR` country has been excluded :(
How to solve it with version >= 5.1.0?
import { matchIsValidTel } from 'mui-tel-input'
matchIsValidTel('+33626766XXX', { excludedCountries: ['FR'] }) // `false` :)
You can also pass onlyCountries
and continents
to the second object parameter.
More details:
export declare function matchIsValidTel(text: string, options?: {
excludedCountries?: MuiTelInputCountry[];
onlyCountries?: MuiTelInputCountry[];
continents?: MuiTelInputContinent[];
}): boolean;
Chore
- Update deps