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

View File

@ -22,7 +22,7 @@ const MainLayout: FC = ({ children }) => {
>
<aside
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'
)}
>