mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-27 16:26:16 +08:00
dadefdee77
Add autoComplete, autoCorrect, autoCapitalize, and spellCheck attributes to prevent macOS from auto-capitalizing the first letter in input fields.
28 lines
958 B
TypeScript
28 lines
958 B
TypeScript
import * as React from "react";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;
|
|
|
|
const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
({ className, type, ...props }, ref) => {
|
|
return (
|
|
<input
|
|
type={type}
|
|
className={cn(
|
|
"flex h-9 w-full rounded-md border border-border-default bg-background text-foreground px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-blue-500/20 dark:focus:ring-blue-400/20 disabled:cursor-not-allowed disabled:opacity-50",
|
|
className,
|
|
)}
|
|
autoComplete="off"
|
|
autoCorrect="off"
|
|
autoCapitalize="off"
|
|
spellCheck={false}
|
|
ref={ref}
|
|
{...props}
|
|
/>
|
|
);
|
|
},
|
|
);
|
|
Input.displayName = "Input";
|
|
|
|
export { Input };
|