Skip to content

Commit

Permalink
fix(ui): prevent iOS chrome zoom on input focus
Browse files Browse the repository at this point in the history
  • Loading branch information
sawaYch committed Mar 6, 2024
1 parent 3473c50 commit a0d78d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/ui/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import { cn } from '@/lib/utils';
export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}

/* NOTE: mobile please use text-base otherwise iOS chrome will scale up the whole webapp on input focus */
const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, ...props }, ref) => {
return (
<input
type={type}
className={cn(
'flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
'flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
className
)}
ref={ref}
Expand Down

0 comments on commit a0d78d4

Please sign in to comment.