+ @if (! $this->mountedAction)
+
+ {{ $this->buttonAction }}
+
-
- {{ $this->linkAction }}
-
+
+ {{ $this->linkAction }}
+
-
- {{ $this->iconButtonAction }}
-
+
+ {{ $this->iconButtonAction }}
+
-
- {{ $this->dangerAction }}
-
+
+ {{ $this->dangerAction }}
+
-
- {{ $this->largeAction }}
-
+
+ {{ $this->largeAction }}
+
-
- {{ $this->iconAction }}
-
+
+ {{ $this->iconAction }}
+
-
- {{ $this->iconAfterAction }}
+
+ {{ $this->iconAfterAction }}
+
+
+
+ {{ $this->confirmationModalAction }}
+
+ @endif
+
+
+
diff --git a/docs-assets/screenshots/images/actions/modal/confirmation.jpg b/docs-assets/screenshots/images/actions/modal/confirmation.jpg
new file mode 100644
index 0000000000..7a5bed1fd9
Binary files /dev/null and b/docs-assets/screenshots/images/actions/modal/confirmation.jpg differ
diff --git a/docs-assets/screenshots/schema.js b/docs-assets/screenshots/schema.js
index eb363d6e0d..174545dda1 100644
--- a/docs-assets/screenshots/schema.js
+++ b/docs-assets/screenshots/schema.js
@@ -27,6 +27,21 @@ export default {
url: 'actions',
selector: '#iconAfterAction',
},
+ 'actions/modal/confirmation': {
+ url: 'actions',
+ viewport: {
+ width: 640,
+ height: 480,
+ deviceScaleFactor: 3,
+ },
+ before: async (page, browser) => {
+ await page.click('#confirmationModalAction button')
+ await page.waitForSelector('#modal h2')
+
+ await page.waitForTimeout(300)
+ },
+ selector: 'body',
+ },
'app/dashboard': {
url: 'admin',
selector: 'body',
diff --git a/docs-assets/screenshots/script.js b/docs-assets/screenshots/script.js
index 5b1378499a..86108a2838 100644
--- a/docs-assets/screenshots/script.js
+++ b/docs-assets/screenshots/script.js
@@ -27,6 +27,10 @@ for (const [file, options] of Object.entries(schema)) {
waitUntil: 'networkidle2',
})
+ if (options.before) {
+ await options.before(page, browser)
+ }
+
const element = await page.waitForSelector(options.selector)
await element.screenshot({ path: `images/${file}.jpg` })
diff --git a/packages/actions/docs/04-modals.md b/packages/actions/docs/04-modals.md
index 2ece41e7ba..e479cab699 100644
--- a/packages/actions/docs/04-modals.md
+++ b/packages/actions/docs/04-modals.md
@@ -14,6 +14,8 @@ Action::make('delete')
->requiresConfirmation()
```
+
+
> Note: The confirmation modal is not available when a `url()` is set instead of an `action()`. Instead, you should redirect to the URL within the `action()` callback.
## Setting a modal heading, subheading, and button label
@@ -136,4 +138,4 @@ Action::make('create')
->action('create')
->modalHidden(fn (): bool => $this->role !== 'admin')
->modalContent(view('filament.pages.actions.create'))
-```
\ No newline at end of file
+```