You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similarly, there are options for [displaying errors](https://api.slack.com/surfaces/modals/using#displaying_errors) in response to view submissions.
27
27
Read more about view submissions in our <ahref="https://api.slack.com/surfaces/modals/using#handling_submissions">API documentation</a>.
28
28
29
+
---
30
+
31
+
##### Handling views on close
32
+
33
+
When listening for `view_closed` requests, you must pass `callback_id` and add a `notify_on_close` property to the view during creation. See below for an example of this:
34
+
35
+
See the <ahref="https://api.slack.com/surfaces/modals/using#modal_cancellations">API documentation</a> for more information about view_closed.
36
+
37
+
```python
38
+
39
+
client.views_open(
40
+
trigger_id=body.get("trigger_id"),
41
+
view={
42
+
"type": "modal",
43
+
"callback_id": "modal-id", # Used when calling view_closed
44
+
"title": {
45
+
"type": "plain_text",
46
+
"text": "Modal title"
47
+
},
48
+
"blocks": [],
49
+
"close": {
50
+
"type": "plain_text",
51
+
"text": "Cancel"
52
+
},
53
+
"notify_on_close": True, # This attribute is required
0 commit comments