fix(phone-input): add Austria mask and prevent double plus prefix (#26626)

* fix(phone-input): add Austria mask and prevent double plus prefix (#24193)

* updated code

* Update Austria phone mask format

---------

Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
This commit is contained in:
Abhay Mishra
2026-01-13 19:22:15 +00:00
committed by GitHub
co-authored by Anik Dhabal Babu
parent 4226231b8a
commit 5fa76f943b
@@ -14,6 +14,7 @@ import classNames from "@calcom/ui/classNames";
const CUSTOM_PHONE_MASKS = {
ci: ".. .. .. .. ..",
bj: ".. .. .. .. ..",
at: "... ..........",
};
export type PhoneInputProps = {
@@ -80,7 +81,7 @@ function BasePhoneInput({
autoComplete: "tel",
}}
onChange={(val: string) => {
onChange(`+${val}`);
onChange(val.startsWith("+") ? val : `+${val}`);
}}
containerClass={classNames(
"hover:border-emphasis focus-within:border-emphasis border-default !bg-default rounded-md border focus-within:outline-none focus-within:ring-0 focus-within:ring-brand-default disabled:cursor-not-allowed",
@@ -132,7 +133,7 @@ function BasePhoneInputWeb({
autoComplete: "tel",
}}
onChange={(val: string) => {
onChange(`+${val}`);
onChange(val.startsWith("+") ? val : `+${val}`);
}}
containerClass={classNames(
"hover:border-emphasis focus-within:border-emphasis border-default !bg-default rounded-md border focus-within:outline-none focus-within:ring-0 focus-within:ring-brand-default disabled:cursor-not-allowed",