Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/features/components/phone-input/PhoneInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import classNames from "@calcom/ui/classNames";
const CUSTOM_PHONE_MASKS = {
ci: ".. .. .. .. ..",
bj: ".. .. .. .. ..",
at: "... ..........",
};

export type PhoneInputProps = {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Loading