set component interaction in loop

...only when an interaction was handled
This commit is contained in:
itsMapleLeaf
2023-09-27 22:15:41 -05:00
parent b463ce3cf4
commit 156cf90919
2 changed files with 9 additions and 6 deletions

View File

@@ -0,0 +1,5 @@
---
"reacord": patch
---
fix interaction handling

View File

@@ -47,14 +47,12 @@ export abstract class Renderer {
} }
handleComponentInteraction(interaction: ComponentInteraction) { handleComponentInteraction(interaction: ComponentInteraction) {
for (const node of this.nodes) {
if (node.handleComponentInteraction(interaction)) {
this.componentInteraction = interaction this.componentInteraction = interaction
setTimeout(() => { setTimeout(() => {
this.updates.next({ action: "deferUpdate", interaction }) this.updates.next({ action: "deferUpdate", interaction })
}, 500) }, 500)
for (const node of this.nodes) {
if (node.handleComponentInteraction(interaction)) {
return true return true
} }
} }