Skip to content

Commit 649669f

Browse files
feature: action dynamic backdrop option (#303)
* feature: action dynamic backdrop option * rename to `close_modal_on_backdrop_click` * add VersionReq --------- Co-authored-by: Paul Bob <paul.ionut.bob@gmail.com>
1 parent 5793fdf commit 649669f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/3.0/actions.md

+19
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,25 @@ self.authorize = -> {
563563
}
564564
```
565565

566+
## Actions close modal on backdrop click
567+
568+
<VersionReq version="3.14.0" />
569+
570+
By default, action modals use a dynamic backdrop. Add `self.close_modal_on_backdrop_click = false` in case you want to prevent the user from closing the modal when clicking on the backdrop.
571+
572+
```ruby{3}
573+
class Avo::Actions::DummyAction < Avo::BaseAction
574+
self.name = "Dummy action"
575+
self.close_modal_on_backdrop_click = false
576+
577+
def handle(query:, fields:, current_user:, resource:, **args)
578+
# Do something here
579+
580+
succeed 'Yup'
581+
end
582+
end
583+
```
584+
566585
## Custom action arguments
567586

568587
Actions can have different behaviors according to their host resource. In order to achieve that, arguments can receive additional arguments as follows:

0 commit comments

Comments
 (0)