Skip to content

Commit 3e3a6c4

Browse files
committed
adding documentation for action confirm option
#257
1 parent 14d89f9 commit 3e3a6c4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/components/action.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ data: {
3838
}
3939
```
4040

41+
### Confirm
42+
43+
When specified, a [browser-native confirm dialog](https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm) is shown before the action is actually performed. The action only is performed after the user confirms. The action is not performed if the user declines to confirm dialog.
44+
45+
```ruby
46+
confirm: {
47+
text: "Do you really want to delete this item?"
48+
}
49+
```
50+
51+
If no `text` is given, the default text "Are you sure?" will be used.
52+
53+
```ruby
54+
confirm: true
55+
```
56+
4157
### Success
4258

4359
The success part of the action component gets triggered once the action we wanted to perform returns a success code, usually the `200` HTTP status code.

0 commit comments

Comments
 (0)