forked from MapComplete/MapComplete
Add support for 'contact:email','contact:phone' and 'contact:website' (write to 'email', 'phone' and 'website' if changed) - fix #601; remove 'tel:' from phone addresses - fix #602; small fixes to tag preview in case of deletion
This commit is contained in:
parent
a35b1d34f4
commit
4fd30d1a62
4 changed files with 39 additions and 7 deletions
|
@ -406,9 +406,17 @@ export default class ValidatedTextField {
|
|||
if (str === undefined) {
|
||||
return false;
|
||||
}
|
||||
if(str.startsWith("tel:")){
|
||||
str = str.substring("tel:".length)
|
||||
}
|
||||
return parsePhoneNumberFromString(str, (country())?.toUpperCase() as any)?.isValid() ?? false
|
||||
},
|
||||
(str, country: () => string) => parsePhoneNumberFromString(str, (country())?.toUpperCase() as any).formatInternational(),
|
||||
(str, country: () => string) => {
|
||||
if(str.startsWith("tel:")){
|
||||
str = str.substring("tel:".length)
|
||||
}
|
||||
return parsePhoneNumberFromString(str, (country())?.toUpperCase() as any).formatInternational();
|
||||
},
|
||||
undefined,
|
||||
"tel"
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue