ensure action rows handle child interactions
This commit is contained in:
5
.changeset/modern-shirts-kneel.md
Normal file
5
.changeset/modern-shirts-kneel.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"reacord": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
ensure action rows handle child interactions
|
||||||
@@ -2,6 +2,7 @@ import type { ReactNode } from "react"
|
|||||||
import { ReacordElement } from "../../internal/element.js"
|
import { ReacordElement } from "../../internal/element.js"
|
||||||
import type { MessageOptions } from "../../internal/message"
|
import type { MessageOptions } from "../../internal/message"
|
||||||
import { Node } from "../../internal/node.js"
|
import { Node } from "../../internal/node.js"
|
||||||
|
import type { ComponentInteraction } from "../../internal/interaction.js"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Props for an action row
|
* Props for an action row
|
||||||
@@ -44,4 +45,12 @@ class ActionRowNode extends Node<ActionRowProps> {
|
|||||||
child.modifyMessageOptions(options)
|
child.modifyMessageOptions(options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
handleComponentInteraction(interaction: ComponentInteraction) {
|
||||||
|
for (const child of this.children) {
|
||||||
|
if (child.handleComponentInteraction(interaction)) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user