uswds
uswds copied to clipboard
USWDS - Bug: Modals break DOM
Describe the bug
If a modal is coded within a form tag, fields in the modal will not be included when the form is submitted and an input type="submit" button will not work because the modal is rebuilt at the end of the DOM extracting it from the form. It is possible to workaround using JavaScript, however a simple confirm type modal for a form should not require it.
Steps to reproduce the bug
- Code a form containing a modal that includes an input type="submit" button
- Cause the modal to open
- Click the submit button This results in the form not being submitted.
Expected Behavior
The content of the modal should remain within the original DOM structure. For the
`Screenshots
No response
System setup
- USWDS version: 3.0.0
Additional context
[https://gsa-tts.slack.com/archives/C3F14AHSQ/p1660061984483449](Slack thread)
Code of Conduct
- [X] I agree to follow this project's Code of Conduct.
- [X] I checked the current issues for duplicate bug reports.