Fix error positon property

* remove useless prop types
This commit is contained in:
Defectink
2022-03-07 15:49:54 +08:00
parent 36b7b35797
commit 58a23b0768
2 changed files with 12 additions and 16 deletions

View File

@ -1,22 +1,17 @@
import { import { forwardRef, DetailedHTMLProps, InputHTMLAttributes } from 'react';
ChangeEventHandler,
HTMLInputTypeAttribute,
KeyboardEventHandler,
forwardRef,
} from 'react';
import cn from 'classnames'; import cn from 'classnames';
interface Props { interface Props
className?: string; extends DetailedHTMLProps<
placeholder?: string; InputHTMLAttributes<HTMLInputElement>,
value?: string | number | readonly string[] | undefined; HTMLInputElement
type?: HTMLInputTypeAttribute | undefined; > {}
onChange?: ChangeEventHandler<HTMLInputElement> | undefined;
onKeyUp?: KeyboardEventHandler<HTMLInputElement> | undefined;
}
const RUAInput = forwardRef<HTMLInputElement, Props>( const RUAInput = forwardRef<HTMLInputElement, Props>(
({ className, placeholder, value, onChange, onKeyUp, type }, ref) => { (
{ className, placeholder, value, onChange, onKeyUp, type, ...rest },
ref
) => {
return ( return (
<> <>
<input <input
@ -34,6 +29,7 @@ const RUAInput = forwardRef<HTMLInputElement, Props>(
value={value} value={value}
onChange={onChange} onChange={onChange}
onKeyUp={onKeyUp} onKeyUp={onKeyUp}
{...rest}
/> />
</> </>
); );

View File

@ -22,7 +22,7 @@ const MainLayout: FC = ({ children }) => {
> >
<aside <aside
className={cn( className={cn(
'col-span-12 px-2 sticky top-8', 'col-span-12 px-2 top-8',
'md:col-span-3 lg:col-span-2 xl:col-span-1' 'md:col-span-3 lg:col-span-2 xl:col-span-1'
)} )}
> >