question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error Message Not Showing for Multiselect Menu Modal

See original GitHub issue

I would like to display an error message in a modal similar to this example: https://api.slack.com/surfaces/modals/using#displaying_errors. Right now I’m using this code for a multiselect menu: https://slack.dev/bolt-python/concepts#view_submissions.

I do something like this:

client.views_open(
    view={
        "type": "modal",
        "callback_id": "view_1",
        "title": {
          "type": "plain_text",
          "text": "My App",
          "emoji": True
        },
        "submit": {
          "type": "plain_text",
          "text": "Submit",
          "emoji": True
        },
        "close": {
          "type": "plain_text",
          "text": "Cancel",
          "emoji": True
        },
        "blocks": [
          {
            "type": "section",
            "block_id": "block1",
            "text": {
              "type": "mrkdwn",
              "text": "*Select channel*"
            },
            "accessory": {
              "type": "multi_conversations_select",
              "placeholder": {
                "type": "plain_text",
                "text": "Select Channels",
                "emoji": True
              },
              "action_id": "multi_conversations_select-action"
            }
          }
        ]
    }
  )

Then later:

@slackApp.view("view_1")
def handle_submission(ack, body, client, view):
  errors = {}

  channels = view["state"]["values"]["block1"]["multi_conversations_select-action"]["selected_conversations"]
  if not channels:
    errors["block1"] = "Please Select a Channel"
  if len(errors) > 0:
    print(errors)
    ack(response_action="errors", errors=errors)
    return 

But no red error message shows up on my view saying “Please Select a Channel.” I have tried the same thing with a simple input text box (no drop down menu) with “type”: “plain_text_input” and the red error box does pop up. Is there something I’m missing here?

Another thing I’ve noticed: whenever I choose something from the select menu, I always have this little exclamation point next to the selection box (I assume this means something’s going wrong, I’m just not sure what). I don’t get any error messages and the submission is able to go through successfully though.

image

Thank you!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
seratchcommented, May 22, 2022

I don’t have anything that I can share at this moment.

1reaction
seratchcommented, May 22, 2022

@arnav13081994 No, it isn’t. The workaround that you are already doing is the only thing that I can suggest.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap multiselect plugin not working dropdownlist not ...
The problem is when I open the modal the second time the button is visible but no dropdownlist, i have tried to replace...
Read more >
Multiselect dropdown list not showing when initial value set ...
I have a multiselect in a form on a pop up window and I finally got the initial value(s) from the model showing...
Read more >
Multi Select control is not working on Modal Dialog window ...
In the multiselect control on the grid the section that is getting loaded is non-template and the multiselect control is templatized control.
Read more >
JavaScript · Bootstrap
Don't use data attributes from multiple plugins on the same element. For example, a button cannot both have a tooltip and toggle a...
Read more >
Select | Quasar Framework
The QSelect Vue component has two types of selection - single or multiple. This component opens up a menu for the selection list...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found