moj-frontend icon indicating copy to clipboard operation
moj-frontend copied to clipboard

Error messages copied from first add-another item

Open taomoh opened this issue 3 years ago • 0 comments

Prerequisites

  • [X] Put an X between the brackets on this line if you have done all of the following:
    • Reproduced the problem
    • Followed all applicable steps in the debugging guide
    • Checked the FAQs on the message board for common solutions
    • Checked that your issue doesn't exist: https://github.com/ministryofjustice/moj-frontend/issues
    • Checked that there is not already a package that provides the described functionality

Description

The mechanism used by MoJ "add-another" component to copy items includes error messages in the copy.

Steps to Reproduce

  1. Populate first "add-another" item and validate in a way that displays an error message: Error in first item

  2. Press the Add button, to add a new item

Expected behaviour: The newly added item should not have any error messages

Actual behaviour: [What happens] The error message from the first item is replicated in the newly added item: Error copied in added item

Reproduces how often: [What percentage of the time does it reproduce?] 100%

Versions

@ministryofjustice/frontend: 1.3.0 OS: Ubuntu 20.04.4 LTS Browser: Chrome 100.0.4896.60 (Official Build) (64-bit)

Additional Information

N/A

taomoh avatar Apr 07 '22 15:04 taomoh