Skip to content

Scheduling infrastructure for absolutely everyone.

fix: reccuring input width (#8227)

Joe17f48614ff16
diff --git a/apps/web/components/booking/pages/AvailabilityPage.tsx b/apps/web/components/booking/pages/AvailabilityPage.tsx
index 40bb48330e9..90ea4af37a2 100644
--- a/apps/web/components/booking/pages/AvailabilityPage.tsx
+++ b/apps/web/components/booking/pages/AvailabilityPage.tsx
@@ -24,7 +24,7 @@ import { getRecurringFreq } from "@calcom/lib/recurringStrings";
import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@calcom/lib/telemetry";
import { detectBrowserTimeFormat, setIs24hClockInLocalStorage, TimeFormat } from "@calcom/lib/timeFormat";
import { trpc } from "@calcom/trpc";
-import { HeadSeo, useCalcomTheme } from "@calcom/ui";
+import { HeadSeo, NumberInput, useCalcomTheme } from "@calcom/ui";
import { CreditCard, User, RefreshCcw } from "@calcom/ui/components/icon";
import { timeZone as localStorageTimeZone } from "@lib/clock";
@@ -226,16 +226,18 @@ const AvailabilityPage = ({ profile, eventType, ...restProps }: Props) => {
<p className="mb-1 -ml-2 inline px-2 py-1">
{getRecurringFreq({ t, recurringEvent: eventType.recurringEvent })}
</p>
- <input
- type="number"
+
+ <NumberInput
+ defaultValue={eventType.recurringEvent.count}
min="1"
max={eventType.recurringEvent.count}
- className="w-15 border-default bg-default dark:border-empthasis h-7 rounded-sm text-sm font-medium [appearance:textfield] ltr:mr-2 rtl:ml-2"
- defaultValue={eventType.recurringEvent.count}
+ isFullWidth={false}
+ className="me-2 inline w-16"
onChange={(event) => {
setRecurringEventCount(parseInt(event?.target.value));
}}
/>
+
<p className="inline">
{t("occurrence", {
count: recurringEventCount,
diff --git a/packages/ui/components/form/index.ts b/packages/ui/components/form/index.ts
index 29c00ea19e5..cab81972dc3 100644
--- a/packages/ui/components/form/index.ts
+++ b/packages/ui/components/form/index.ts
@@ -15,6 +15,7 @@ export {
TextAreaField,
TextField,
InputFieldWithSelect,
+ NumberInput,
} from "./inputs/Input";
export { Label } from "./inputs/Label";
export { Select, SelectField, SelectWithValidation, getReactSelectProps } from "./select";
diff --git a/packages/ui/components/form/inputs/Input.tsx b/packages/ui/components/form/inputs/Input.tsx
index dbdd3dc80f1..195a0c7a041 100644
--- a/packages/ui/components/form/inputs/Input.tsx
+++ b/packages/ui/components/form/inputs/Input.tsx
@@ -406,3 +406,17 @@ export const InputFieldWithSelect = forwardRef<
/>
);
});
+
+export const NumberInput = forwardRef<HTMLInputElement, InputFieldProps>(function NumberInput(props, ref) {
+ return (
+ <Input
+ ref={ref}
+ type="number"
+ autoCapitalize="none"
+ autoComplete="numeric"
+ autoCorrect="off"
+ inputMode="numeric"
+ {...props}
+ />
+ );
+});
diff --git a/packages/ui/index.tsx b/packages/ui/index.tsx
index c50eb3f529d..5bda0c11dae 100644
--- a/packages/ui/index.tsx
+++ b/packages/ui/index.tsx
@@ -56,6 +56,7 @@ export {
SettingsToggle,
Stepper,
Switch,
+ NumberInput,
} from "./components/form";
export type { ITimezone, ITimezoneOption } from "./components/form";
export {