Next.js Discord

Discord Forum

suddenly I can't write in input

Unanswered
White-tailed Tropicbird posted this in #help-forum
Open in Discord
White-tailed TropicbirdOP
I have a small problem, where I suddenly can't write in any input of a form, without me changing anything, and I tried the most common solutions for it, but it's still not letting me write in that input, I can use auto complete suggestions, but I can't use the keyboard to type in it.

import {InputText} from "primereact/inputtext";

import "./index.css";

interface ModalInputProps {
    text: string;
    help?: string;
    placeholder?: string;
    type?: HTMLInputTypeAttribute;
    required?: boolean;
    name?: string;
    default?: string;
    className?: string;
}

export default function ModalInput(props: ModalInputProps): ReactElement {
    const [value, setValue]: StateTuple<string> = useState<string>(props.default ?? "");

    function handleSetValue(event: ChangeEvent<HTMLInputElement>): void {
        console.log(event.target.value);
        setValue(event.target.value);
    }

    return (
        <div className="modal-input">
            <label htmlFor="modal-input">{props.text}</label>
            <InputText
                name={props.name ?? ""}
                required={props.required ?? false}
                id="modal-input"
                aria-describedby="username-help"
                placeholder={props.placeholder}
                type={props.type}
                className={props.className ?? ""}
                value={value}
                onChange={handleSetValue}
            />
            {props.help &&
                <small id="username-help">
                    {props.help}
                </small>
            }
        </div>
    );
}


here is the code for the component.

0 Replies