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
If you have a dynamic form where elements are added and removed, the <form> element continuously gets event listeners bound, but they aren't all cleared when a component is removed. If the component has assume interactions, those are removed.
Every new component adds to the form's formdata, submit & reset handlers.
Our use involves many components being added and removed over time, and its possible for a user to go for several hours without actually submitting the form. This causes quite a buildup in memory.
The text was updated successfully, but these errors were encountered:
- Work-around for shoelace-style/shoelace#2376
- Fix some missing cleanup & a few other minor improvements for etemplate widgets
- Stop egw from holding on to registered plugins (& every instance)
Describe the bug
If you have a dynamic form where elements are added and removed, the
<form>
element continuously gets event listeners bound, but they aren't all cleared when a component is removed. If the component has assume interactions, those are removed.Every new component adds to the form's formdata, submit & reset handlers.
See https://github.com/shoelace-style/shoelace/blob/next/src/internal/form.ts#L187
Only when the last element is removed from the form are all these handlers removed.
To Reproduce
Steps to reproduce the behavior:
See the demo.
Demo
https://codepen.io/nathangray-the-flexboxer/pen/YPzPjWZ?editors=1000
If you use developer tools inspect the form, you can see that while the form has 1 input, it has 101 listeners bound.
Screenshots
Additional information
Our use involves many components being added and removed over time, and its possible for a user to go for several hours without actually submitting the form. This causes quite a buildup in memory.
The text was updated successfully, but these errors were encountered: