You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a form control (e.g. sl-input) is removed from the DOM, either programmatically or through conditional rendering, it is still included in the form's validation process upon submission. This results in the form being unable to submit, due to validation errors on the removed element preventing the submission.
Describe the bug
When a form control (e.g.
sl-input
) is removed from the DOM, either programmatically or through conditional rendering, it is still included in the form's validation process upon submission. This results in the form being unable to submit, due to validation errors on the removed element preventing the submission.The following condition in
FormControlController
may be the reason why listeners are not being detached upon element disconnection:https://github.com/shoelace-style/shoelace/blob/next/src/internal/form.ts#L188
This issue may also be related to issue #1841
To Reproduce
Steps to reproduce the behavior:
Demo
https://codepen.io/alenaksu/pen/KwPeWzx?editors=1010
Screenshots
N/A
Browser / OS
Additional information
N/A
The text was updated successfully, but these errors were encountered: