Next.js Discord

Discord Forum

Unable to type anything on the textarea

Answered
Jenn posted this in #help-forum
Open in Discord
I am using shadcn Textarea and I cannot type anything on it:
 <Label.Root htmlFor="Remarks" className="block text-sm font-medium leading-6 text-cyan-600">Remarks</Label.Root>
              <Textarea placeholder="Type your message here." 
                id="remarks"
                value={formValue && formValue.remarks ? formValue.remarks.toString() : ''}
                onChange={(event) => setFormValue({ ...formValue, [event.target.name]: event.target.value })}
              />

If I change the textare to input , everything just works.

  const [formValue, setFormValue] = useState<WaterStationFormData>({
    name: "",
  //rest of the codes
    remarks: null,
  });
 
Answered by Ray
add this to Textarea
name="remarks"
View full answer

3 Replies

add this to Textarea
name="remarks"
Answer
Oh thank you. I was missing the "name"
@Jenn Oh thank you. I was missing the "name"
np😆