import * as React from "react" import { cn } from "@/lib/utils" export type InputProps = React.InputHTMLAttributes const Input = React.forwardRef( ({ className, type, onWheel, ...props }, ref) => { // Prevent the mouse wheel from silently mutating a focused number input // (e.g. scrolling the page over a salary field turning 20000 into 19998). // Blurring drops focus so the wheel scrolls the page instead of the value. const handleWheel = React.useCallback( (e: React.WheelEvent) => { if (type === 'number') { e.currentTarget.blur() } onWheel?.(e) }, [type, onWheel] ) return ( ) } ) Input.displayName = "Input" export { Input }