aws-amplify / aws-amplify/amplify-studio

Form with relationships shows field as required even after cancelling the add item

Open
#964 0 comments 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

d1d64siqsqavbr

### Region

us-east-1

### Environment name

dev

### 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?

_No response_

### Browser type?

_No response_

### Describe the bug

As the following video demonstrates, the required does not disappear until i select a value then I cancel it

https://github.com/aws-amplify/amplify-studio/assets/87995712/798b0d29-77a2-4913-ae4a-de814d46e58b

but if you have no records for example

https://github.com/aws-amplify/amplify-studio/assets/87995712/52a2c22c-a073-4fb6-901a-e90243a2a820

but i refresh the page then submit it

https://github.com/aws-amplify/amplify-studio/assets/87995712/024aadc2-8c9d-4fad-b26f-e5e0e91e7ff3

### Expected behavior

remove the required when clicking on cancel and throw error when submitting

### Reproduction steps

1. use the auto generated form with required relationship field
2. dont add any records to the table
3. try adding a relationship as show in the video
4. observe behaviour

### Project Identifier

_No response_

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the autogenerated form scenario with a required relationship field and no records in the table, following the listed cancellation and submission steps. The fix is done when cancelling removes the required state and submitting without a relationship produces the expected validation error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.