Skip to content

Explicitly passing props to avoid warning #2770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
53 changes: 42 additions & 11 deletions src/app-components/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,31 @@ export type InputProps = {
>;

export function Input(props: InputProps) {
const { size = 'sm', readOnly, ...rest } = props;
const {
size = 'sm',
prefix,
suffix,
characterLimit,
error,
disabled,
id,
readOnly,
type,
value,
className,
'aria-label': ariaLabel,
'aria-describedby': ariaDescribedby,
onChange,
onBlur,
autoComplete,
required,
placeholder,
inputMode,
style,
textonly,
} = props;

const handlePaste = (event: React.ClipboardEvent<HTMLInputElement>) => {
if (readOnly) {
event.preventDefault();
}
};

if (props.textonly) {
const { value, id, className } = props;
if (textonly) {
if (value === null || (typeof value === 'string' && value.length === 0)) {
return null;
}
Expand All @@ -62,10 +77,26 @@ export function Input(props: InputProps) {

return (
<Textfield
onPaste={handlePaste}
size={size}
prefix={prefix}
suffix={suffix}
type={type}
characterLimit={characterLimit}
error={error}
id={id}
readOnly={readOnly}
{...rest}
disabled={disabled}
value={value}
className={className}
aria-label={ariaLabel}
aria-describedby={ariaDescribedby}
onChange={onChange}
onBlur={onBlur}
autoComplete={autoComplete}
required={required}
placeholder={placeholder}
inputMode={inputMode}
style={style}
/>
);
}
1 change: 0 additions & 1 deletion src/layout/InstantiationButton/InstantiationButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export const InstantiationButton = ({ children, ...props }: Props) => {

return (
<Button
{...props}
id={props.node.id}
onClick={onClick}
isLoading={isLoading}
Expand Down
Loading