forked from MapComplete/MapComplete
		
	Remove mailto: prefix automatically in the email field
This commit is contained in:
		
							parent
							
								
									83641d2494
								
							
						
					
					
						commit
						9916371122
					
				
					 1 changed files with 13 additions and 2 deletions
				
			
		|  | @ -350,8 +350,19 @@ export default class ValidatedTextField { | |||
|         ValidatedTextField.tp( | ||||
|             "email", | ||||
|             "An email adress", | ||||
|             (str) => EmailValidator.validate(str), | ||||
|             undefined, | ||||
|             (str) => { | ||||
|                 if(str.startsWith("mailto:")){ | ||||
|                     str = str.substring("mailto:".length) | ||||
|                 } | ||||
|                 return EmailValidator.validate(str); | ||||
|             }, | ||||
|             str => { | ||||
|                 if(str === undefined){return undefined} | ||||
|                 if(str.startsWith("mailto:")){ | ||||
|                     str = str.substring("mailto:".length) | ||||
|                 } | ||||
|                 return str; | ||||
|             }, | ||||
|             undefined, | ||||
|             "email"), | ||||
|         ValidatedTextField.tp( | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue