Use closeModalByEscaping instead of closedByEscaping

This commit is contained in:
Marcel
2024-07-31 13:59:22 +02:00
committed by GitHub
parent 777c3ca5ca
commit f00aea607f
+2 -2
View File
@@ -508,7 +508,7 @@ Modal::closedByClickingAway(false);
## Closing the modal by escaping
By default, when you press escape on a modal, it will close itself. If you wish to disable this behavior for a specific action, you can use the `closedByEscaping(false)` method:
By default, when you press escape on a modal, it will close itself. If you wish to disable this behavior for a specific action, you can use the `closeModalByEscaping(false)` method:
```php
Action::make('updateAuthor')
@@ -518,7 +518,7 @@ Action::make('updateAuthor')
->action(function (array $data): void {
// ...
})
->closedByEscaping(false)
->closeModalByEscaping(false)
```
If you'd like to change the behavior for all modals in the application, you can do so by calling `Modal::closedByEscaping()` inside a service provider or middleware: