1

I have a form with multiple inputs on Slack. Radio buttons appear to work as 'Submit' buttons.

I want to send the form at the end when pressing the Submit button.

Code example:

{
"blocks": [
    {
        "type": "section",
        "text": {
            "type": "mrkdwn",
            "text": "Section block with radio buttons"
        },
        "accessory": {
            "type": "radio_buttons",
            "options": [
                {
                    "text": {
                        "type": "plain_text",
                        "text": "Option1",
                        "emoji": true
                    },
                    "value": "value-0"
                },
                {
                    "text": {
                        "type": "plain_text",
                        "text": "Option2",
                        "emoji": true
                    },
                    "value": "value-1"
                }
            ],
            "action_id": "radio_buttons-action"
        }
    },
    {
        "type": "actions",
        "elements": [
            {
                "type": "button",
                "text": {
                    "type": "plain_text",
                    "text": "Submit",
                    "emoji": true
                },
                "value": "click_me_123",
                "action_id": "actionId-0"
            }
        ]
    }
]
}

How can I disable radio buttons from acting as submit buttons?

Alex Busuioc
  • 992
  • 1
  • 11
  • 24
  • What do you mean by "appear to work as 'Submit' buttons" ? I really don't think code for submit button is triggered for this – Deekshith Hegde Oct 23 '21 at 15:40
  • A request to our backend is being triggered. Apparently, this is the default behavior and cannot be changed. I got an answer from their support team. I'll post it an answer to this question – Alex Busuioc Oct 24 '21 at 10:15

1 Answers1

1

I got an answer from Slack's support team. Apparently, it's impossible to turn off this behavior at this moment.

Slack's support team:

When a user makes use of an interactive component in a modal, that will always dispatch a block_actions payload. This is described here: https://api.slack.com/interactivity/handling#payloads This is designed to accommodate error handling and dynamic adjustments to a modal before submission.

It's not possible to turn this off, but you can safely ignore any block_actions payloads and just process the view_submission payload once you receive that.

Alex Busuioc
  • 992
  • 1
  • 11
  • 24