Skip to content

Fix multiple event listeners#1

Merged
NitemareReal merged 19 commits intodevelopmentfrom
fixMultipleEventListeners
Feb 29, 2024
Merged

Fix multiple event listeners#1
NitemareReal merged 19 commits intodevelopmentfrom
fixMultipleEventListeners

Conversation

@NitemareReal
Copy link
Copy Markdown
Owner

'Drag&Drop' events where binded to each 'upload form' as many times as input fields where present in screen, since loops where nested.
Binding the same event (using ANONYMOUS function) to a component, more than once, DOES really bind the event N times (as opposite of binding non anonymous functions). So, when dropping files onto form, 'drop' event was executed N times and the same file was attached N times to the same item.
The solution is unnest loops, loops must occur one after other.
This code could be easly improved, since inside each 'upload form' there is only one 'input filed' to bind events, there is no need of a second loop, but this is not the point of this fix.

@NitemareReal NitemareReal merged commit d34ac06 into development Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants