我有一个带有 static_select 的松弛模态
{
block_id: "my_block_id",
type: "section",
text: {
type: "mrkdwn",
text: "Please select one"
},
accessory: {
type: "static_select",
action_id: "select_type",
placeholder: {
type: "plain_text",
text: "Select one"
},
options: self.types_options
}
},
当用户选择其中一个选项时会触发后端调用,我是否可以避免这种情况并在点击提交表单按钮时触发调用?
最佳答案
将你的 static_select
放在 input
中而不是部分
。
When someone uses an interactive component in your app's modal views, the app will receive a block_actions payload.
This does not apply to components included in an input block (see below for details about those).
https://api.slack.com/surfaces/modals/using#components
Any interactive components used within input blocks will not send this block_actions payload. They are included in view_submission payloads only.
https://api.slack.com/reference/interaction-payloads/block-actions
关于slack-api - Slack static_select 避免在更改时调用后端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59075388/