development #14
@@ -11,7 +11,9 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
|
||||
<input
|
||||
ref={ref}
|
||||
className={cn(
|
||||
'h-10 w-full rounded-xl border border-border bg-surface px-3 text-sm text-primary placeholder:text-foreground/40 transition-colors focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/30 disabled:cursor-not-allowed disabled:opacity-50',
|
||||
// text-base (16px) en mobile: iOS auto-zoomea al enfocar controles con
|
||||
// font-size < 16px y, al cerrar el teclado, no restaura el scale.
|
||||
'h-10 w-full rounded-xl border border-border bg-surface px-3 text-base sm:text-sm text-primary placeholder:text-foreground/40 transition-colors focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/30 disabled:cursor-not-allowed disabled:opacity-50',
|
||||
invalid && 'border-danger focus:border-danger focus:ring-danger/30',
|
||||
className,
|
||||
)}
|
||||
|
||||
@@ -136,7 +136,7 @@ export function GroupForm({
|
||||
<div>
|
||||
<Label htmlFor="price">Precio</Label>
|
||||
<div className="relative">
|
||||
<span className="pointer-events-none absolute inset-y-0 left-3 flex items-center text-sm text-foreground/50">
|
||||
<span className="pointer-events-none absolute inset-y-0 left-3 flex items-center text-base text-foreground/50 sm:text-sm">
|
||||
$
|
||||
</span>
|
||||
<Input
|
||||
|
||||
@@ -164,4 +164,20 @@
|
||||
@apply bg-background text-primary antialiased transition-colors;
|
||||
min-height: 100dvh;
|
||||
}
|
||||
|
||||
/* iOS (Safari y standalone) hace auto-zoom al enfocar un control de
|
||||
formulario con font-size < 16px, y al cerrar el teclado no restaura el
|
||||
scale: la app queda con zoom. El `Input` ya sube a 16px en mobile
|
||||
(`text-base sm:text-sm`); esto es la red de seguridad para textareas,
|
||||
selects o inputs crudos que se agreguen más adelante.
|
||||
El 639px calza con el breakpoint `sm` de Tailwind. El `!important` es
|
||||
a propósito: sin él, una clase `text-sm` en un input futuro ganaría por
|
||||
especificidad y reintroduciría el bug sin avisar. */
|
||||
@media (max-width: 639px) {
|
||||
input,
|
||||
textarea,
|
||||
select {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user