ensure action rows handle child interactions

This commit is contained in:
itsMapleLeaf
2023-09-27 23:15:24 -05:00
parent 47b0645a90
commit d76f316bb7
2 changed files with 14 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"reacord": patch
---
ensure action rows handle child interactions

View File

@@ -2,6 +2,7 @@ import type { ReactNode } from "react"
import { ReacordElement } from "../../internal/element.js"
import type { MessageOptions } from "../../internal/message"
import { Node } from "../../internal/node.js"
import type { ComponentInteraction } from "../../internal/interaction.js"
/**
* Props for an action row
@@ -44,4 +45,12 @@ class ActionRowNode extends Node<ActionRowProps> {
child.modifyMessageOptions(options)
}
}
handleComponentInteraction(interaction: ComponentInteraction) {
for (const child of this.children) {
if (child.handleComponentInteraction(interaction)) {
return true
}
}
return false
}
}