nextui-org / nextui

🚀 Beautiful, fast and modern React UI library.
https://nextui.org
MIT License
22.01k stars 1.54k forks source link

[BUG] -Textarea loses content after submit #4040

Open rhufsky opened 4 days ago

rhufsky commented 4 days ago

NextUI Version

2.4.8 and 2.5-beta.8 and "@nextui-org/input": "^2.3.0-beta.6", "@nextui-org/system": "^2.3.0-beta.4", "@nextui-org/theme": "^2.3.0-beta.6"

Describe the bug

Textarea seems to temporarily lose its content on form submit with a NextJS server side action that does not refresh the page. I have a Textarea that is used as a controlled component.

Submit is handled by a form action, which is cliend side for sake of brevity.

I use NextJS15 / React 19 RC. I tried NextUI 2.4.8 and NextUI 2.5 beta.

Your Example Website or App

https://github.com/rhufsky/nextui-demo

Steps to Reproduce the Bug or Issue

  1. open the form
  2. enter value in the textarea
  3. hit submit
  4. hover over the textarea

Expected behavior

The textarea should keep its value even after a submit, given the value comes from the state and all other components display the state as well.

The goal is to do verification in a server action. In case of a verification error, the form fields contents should be as entered by the user.

Screenshots or Videos

No response

Operating System Version

MacOS, bun

Browser

Chrome

linear[bot] commented 4 days ago

ENG-1555 [BUG] -Textarea loses content after submit

prudvinani commented 2 days ago

@wingkwong , I would like to work on this issue. Could you please provide a video explaining the exact bug and the location of the component so that I can understand it better?

rhufsky commented 2 days ago

The source code is here: https://github.com/rhufsky/nextui-demo.

The relevant code is in src/components/TextAreaDemoForm.tsx

Start the app:

image

Enter data

image

Hit "Submit", input data in NextUI Textarea disappears and is replaced by default value.

image

Hover over Textarea NextUI, input data reappears

image