slackapi/python-slack-sdk

On the slack app for android phones views.publish method fails to set initial_option on a static select control

akaf47 opened this issue · 3 comments

The Slack SDK version

slack-bolt==1.18.0
slack-sdk==3.23.0

Python runtime version

Python 3.8.18

OS info

Windows 10 OS

Steps to reproduce:

This behaviour is reproduced only on the Slack android app. Web app and windows app of Slack are working correctly.

Use postman (or similar tool) and make the following 2 posts to method: https://slack.com/api/views.publish

  1. Initial post that shows a date picker set to initial option with "text": "Last 3 Days". Works as expected.
{
    "user_id": "xxxxxxx",
    "view": {
        "type": "home",
        "blocks": [
            {
                "type": "section",
                "text": {
                    "type": "mrkdwn",
                    "text": "\ud83d\udc4b *Welcome!*"
                }
            },
            {
                "block_id": "range_date_picker",
                "type": "section",
                "text": {
                    "type": "mrkdwn",
                    "text": "Pick an item from the dropdown list"
                },
                "accessory": {
                    "type": "static_select",
                    "placeholder": {
                        "type": "plain_text",
                        "text": "Select date range",
                        "emoji": true
                    },
                    "options": [
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "Last Day"
                            },
                            "value": "1"
                        },
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "Last 3 Days"
                            },
                            "value": "2"
                        },
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "Last Week"
                            },
                            "value": "3"
                        }
                    ],
                    "initial_option": {
                        "text": {
                            "type": "plain_text",
                            "text": "Last 3 Days"
                        },
                        "value": "2"
                    },
                    "action_id": "demo-time-window-action"
                }
            }
        ]
    }
}
  1. Second post should have changed the initial_option to 'Last Week' but it didn't.
{
    "user_id": "xxxxxxx",
    "view": {
        "type": "home",
        "blocks": [
            {
                "type": "section",
                "text": {
                    "type": "mrkdwn",
                    "text": "\ud83d\udc4b *Welcome!*"
                }
            },
            {
                "block_id": "range_date_picker",
                "type": "section",
                "text": {
                    "type": "mrkdwn",
                    "text": "Pick an item from the dropdown list"
                },
                "accessory": {
                    "type": "static_select",
                    "placeholder": {
                        "type": "plain_text",
                        "text": "Select date range",
                        "emoji": true
                    },
                    "options": [
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "Last Day"
                            },
                            "value": "1"
                        },
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "Last 3 Days"
                            },
                            "value": "2"
                        },
                        {
                            "text": {
                                "type": "plain_text",
                                "text": "Last Week"
                            },
                            "value": "3"
                        }
                    ],
                    "initial_option": {
                        "text": {
                            "type": "plain_text",
                            "text": "Last Week"
                        },
                        "value": "3"
                    },
                    "action_id": "demo-time-window-action"
                }
            }
        ]
    }
}

Thanks for bringing this to our attention, @akaf47! We'll raise this to the responsible team and leave this issue open until we hear back.

👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.