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
Describe the bug
When using Listener with target field and then changing the target field more than once will trigger the old controller instance's asyncLoadData function. This causes the browser to throw an error FormData constructor: Argument 1 is not an object. since the controller's element is already detached.
To Reproduce
Steps to reproduce the behavior:
Create a Screen with a single checkbox
Create a Listener that targets the checkbox
Check/uncheck the checkbox more than once
Expected behavior
No client side error occurred.
Desktop (please complete the following information):
OS: Windows 11
Browser Firefox
Version 121.0.1
Server (please complete the following information):
Platfrom Version: 14
Laravel Version: 10
PHP Version: 8.2
Database: MariaDB
Database Version: 10
Additional context
Seems like the problem's caused by stale event handler pointing to the asyncLoadData. I tried removing the event handler on disconnect to solve it through my own custom controller like follows.
Describe the bug
When using Listener with target field and then changing the target field more than once will trigger the old controller instance's
asyncLoadData
function. This causes the browser to throw an errorFormData constructor: Argument 1 is not an object.
since the controller's element is already detached.To Reproduce
Steps to reproduce the behavior:
Expected behavior
No client side error occurred.
Desktop (please complete the following information):
Server (please complete the following information):
Additional context
Seems like the problem's caused by stale event handler pointing to the
asyncLoadData
. I tried removing the event handler ondisconnect
to solve it through my own custom controller like follows.Not sure if this is the preferred approach though. If so, I can submit a pull request.
The text was updated successfully, but these errors were encountered: