forked from MapComplete/MapComplete
		
	Fix country detection, fix phone number formatting, close #103
This commit is contained in:
		
							parent
							
								
									48ca24261f
								
							
						
					
					
						commit
						cba72ea915
					
				
					 3 changed files with 14 additions and 9 deletions
				
			
		|  | @ -87,11 +87,13 @@ export default class ValidatedTextField { | |||
|             "phone", | ||||
|             "A phone number", | ||||
|             (str, country: any) => { | ||||
|                 if (str === undefined) { | ||||
|                     return false; | ||||
|                 } | ||||
|                 return parsePhoneNumberFromString(str, country?.toUpperCase())?.isValid() ?? false | ||||
|             }, | ||||
|             (str, country: any) => { | ||||
|                 console.log("reformatting phone nuber",str, "for locale", country) | ||||
|                 return parsePhoneNumberFromString(str, country?.toUpperCase()).formatInternational() | ||||
|                 return  parsePhoneNumberFromString(str, country?.toUpperCase()).formatInternational() | ||||
|             } | ||||
|         ) | ||||
|     ] | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue