Files
72690a3985 Allow modal close button (or other dismissive actions) to cancel parent actions (#19781)
* Add parent-action cancellation support to `modalCloseButton()` (#2)

* Add modal close button parent cancellation

Agent-Logs-Url: https://github.com/CamKemBell/filament/sessions/b42b9ac0-2da9-426b-ba8a-1dc091249aaa

Co-authored-by: CamKemBell <217516035+CamKemBell@users.noreply.github.com>

* Polish modal close button cancellation

Agent-Logs-Url: https://github.com/CamKemBell/filament/sessions/b42b9ac0-2da9-426b-ba8a-1dc091249aaa

Co-authored-by: CamKemBell <217516035+CamKemBell@users.noreply.github.com>

* revert: back to original code

* refactor: support for conditional cancellation of parent actions on modal close

* refactor: rename modal close button unmount action methods for clarity

* refactor: simplify modal close button event handler logic

* refactor: simplify modal close button event handler logic

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: CamKemBell <217516035+CamKemBell@users.noreply.github.com>
Co-authored-by: Cam Kemshal-Bell <cam@foremind.com.au>

* Fix: ensure modal close button behavior does not cancel parent actions

* Refocus nested action cancellation on modal dismissal (#3)

* Add modal dismissal parent action API

Agent-Logs-Url: https://github.com/CamKemBell/filament/sessions/53b18b70-43ab-41f7-9798-48fd987b9baf

Co-authored-by: CamKemBell <217516035+CamKemBell@users.noreply.github.com>

* Refine modal dismissal API readability

Agent-Logs-Url: https://github.com/CamKemBell/filament/sessions/53b18b70-43ab-41f7-9798-48fd987b9baf

Co-authored-by: CamKemBell <217516035+CamKemBell@users.noreply.github.com>

* Fix modal dismissal flag handling

Agent-Logs-Url: https://github.com/CamKemBell/filament/sessions/53b18b70-43ab-41f7-9798-48fd987b9baf

Co-authored-by: CamKemBell <217516035+CamKemBell@users.noreply.github.com>

* core: remove modalCloseButton method

* core: remove deprecate tests

* docs: update modal documentation to reflect deprecation of modalCloseButton

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: CamKemBell <217516035+CamKemBell@users.noreply.github.com>
Co-authored-by: Cam Kemshal-Bell <cam@foremind.com.au>

* fix: rename parameter for clarity in modal parent action cancellation

* docs: update modal documentation to clarify parent action cancellation behavior under a new section

* cleanup

* cleanup

* cleanup

* fix scroll locks

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: CamKemBell <217516035+CamKemBell@users.noreply.github.com>
Co-authored-by: Dan Harrin <git@danharrin.com>
2026-07-08 12:20:31 +01:00

92 lines
4.1 KiB
PHP

<?php
namespace Livewire\Features\SupportTesting {
use BackedEnum;
use Closure;
use Filament\Actions\Testing\TestAction;
class Testable {
public function mountAction(string | TestAction | array $actions, array $arguments = []): static {}
public function unmountAction(bool | string | null $cancelParentActions = null): static {}
/**
* @deprecated Use `fillForm()` instead.
*/
public function setActionData(array $data): static {}
/**
* @deprecated Use `assertSchemaStateSet()` instead.
*/
public function assertActionDataSet(array | Closure $data): static {}
public function callAction(string | TestAction | array $actions, array $data = [], array $arguments = []): static {}
public function callMountedAction(array $arguments = []): static {}
public function assertActionExists(string | TestAction | array $actions, ?Closure $checkActionUsing = null, ?Closure $generateMessageUsing = null, array $arguments = []): static {}
public function assertActionDoesNotExist(string | TestAction | array $actions, ?Closure $checkActionUsing = null, ?Closure $generateMessageUsing = null): static {}
public function assertActionVisible(string | TestAction | array $actions, array $arguments = []): static {}
public function assertActionHidden(string | TestAction | array $actions, array $arguments = []): static {}
public function assertActionEnabled(string | TestAction | array $actions): static {}
public function assertActionDisabled(string | TestAction | array $actions): static {}
public function assertActionHasIcon(string | TestAction | array $actions, string | BackedEnum $icon): static {}
public function assertActionDoesNotHaveIcon(string | TestAction | array $actions, string | BackedEnum $icon): static {}
public function assertActionHasLabel(string | TestAction | array $actions, string $label): static {}
public function assertActionHasColor(string | TestAction | array $actions, string $color): static {}
public function assertActionDoesNotHaveColor(string | TestAction | array $actions, string $color): static {}
public function assertActionHasUrl(string | TestAction | array $actions, string $url): static {}
public function assertActionDoesNotHaveUrl(string | TestAction | array $actions, string $url): static {}
public function assertActionShouldOpenUrlInNewTab(string | TestAction | array $actions): static {}
public function assertActionShouldNotOpenUrlInNewTab(string | TestAction | array $actions): static {}
public function assertActionDoesNotHaveLabel(string | TestAction | array $actions, string $label): static {}
public function assertActionMounted(string | TestAction | array $actions): static {}
public function assertActionNotMounted(string | TestAction | array $actions = []): static {}
public function assertMountedActionModalSee(string | array $values, bool $escape = true): static {}
public function assertMountedActionModalDontSee(string | array $values, bool $escape = true): static {}
public function assertMountedActionModalSeeHtml(string | array $values): static {}
public function assertMountedActionModalDontSeeHtml(string | array $values): static {}
public function assertActionHalted(string | TestAction | array $actions = []): static {}
/**
* @deprecated Use `assertHasFormErrors()` instead.
*/
public function assertHasActionErrors(array $keys = []): static {}
/**
* @deprecated Use `assertHasNoFormErrors()` instead.
*/
public function assertHasNoActionErrors(array $keys = []): static {}
public function parseActionName(string | TestAction | array $actions): string {}
public function parseNestedActionName(string | array $name): array {}
public function parseNestedActions(string | TestAction | array $actions, array $arguments = [], bool $areRelativeToMountedActions = true): array {}
}
}