2

I want to add date-picker elements to slack dialog. It is clear that from documentation, we can only add input, text-area, and select elements.

Is there any hack to use date-picker in the slack dialog?

Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114
Subbu
  • 663
  • 1
  • 9
  • 20

2 Answers2

1

I doubt you will find a viable hack since your Slack app needs to run on all platforms supported by Slack clients incl. Windows, MAC, Android and iOS.

Instead, I would suggest to design your interaction with blocks. There you have a datepicker element

Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114
  • I need to create form kind of UI where I can select from and to dates and submit. If I use blocks for the date-pickers, slack will send post request for each select which is difficult to manage state. – Subbu Jul 05 '19 at 20:18
  • yes, its a bit more complicated to manage than a modal window, but it works. And its the only datapicker that Slack offers. Your only other alternative I think is to implement your dialog outside Slack in a browser. – Erik Kalkoken Jul 05 '19 at 20:25
  • I didn't really get you what do you mean by `implementing your dialog outside slack in browser`. Can you elaborate on it? – Subbu Jul 05 '19 at 20:50
  • You could take the user outside Slack to a website, handle the input on the web site and then go back to the Slack app. e.g. use could click on a link button to open a page on your web site. – Erik Kalkoken Jul 05 '19 at 21:02
  • Yes. completely good idea. I feel like taking the user from slack to browser is not a good thing if we consider the UX – Subbu Jul 05 '19 at 21:11
  • Agreed. Its more like a last resort if you have some really complex user input that can not be implemented within Slack. But if you only need a datepicker I would stay within Slack. Much easier to implement it with layout blocks. – Erik Kalkoken Jul 05 '19 at 21:33
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/196065/discussion-between-subbu-and-erik-kalkoken). – Subbu Jul 05 '19 at 21:35
1

There is a latest update to the slack api,Block Kit in modals.

This is like dialog but with all block elements access and they also have many cool features for dynamic views.

Here This is snippet of data-picker block integrated into it.

nikhil
  • 34
  • 3