aws-amplify / aws-amplify/amplify-studio

Clear on Submit Doesn't Clear when Type Changed from TextField to TextAreaField

Open
#1,089 1 comment 0 reactions 0 assignees View on GitHub
bug studio-ui ui-forms
Dominant language
No language data
Stars
135
Forks
32
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-adminui/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-adminui/blob/main/CONTRIBUTING.md#bug-reports).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### App Id

arn:aws:amplify:us-east-1:188426401085:apps/d1kcgq6spbdji7

### Region

us-east-1

### Environment name

staging

### Figma File Version (if applicable)

_No response_

### Amplify CLI Version

_No response_

### If applicable, what version of Node.js are you using?

_No response_

### What operating system are you using?

Windows 11

### Browser type?

Google Chrome

### Describe the bug

I've created a simple ContactUs in my data models in Studio with FirstName, LastName, EmailAddress, and Message. This created a ContactUsCreateFrom component in my UI Library. I clicked Configure, selected the Message field and changed the Type to TextAreaField. The imported this into my local project. Now, when you open the component in the browser, you can type in all your values and select the Submit button. Submit is submitting the value into DynamoDB, however, all the fields except the Message field are clearing the values.

If I just use the default Type of TextField, the field clears out appropriately after selecting Submit.

### Expected behavior

When the underlying data model property type is String and you change the Type of the field within UI Library for the created component to TextAreaField instead of TextField, on pressing Submit, the field would clear it's value after submitting.

### Reproduction steps

1. Create data model with a String type property.
2. Open created component for model in UI Library in Amplify Studio.
3. Click Configure on selected component.
4. Click on field that represents String property from data model.
5. Change Type dropdown to TextAreaField from TextField.
6. Import into local project.
7. Run project with component showing on page and enter data in field.
8. Press Submit button on component.

### Project Identifier

_No response_

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the generated ContactUsCreateFrom component: change a String field from TextField to TextAreaField in Amplify Studio, import it, enter a value, and submit. Compare the generated component's clearing behavior with the default TextField behavior; done means the TextAreaField value also clears after a successful submission.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.