Skip to content

Commit

Permalink
Merge pull request #14220 from wout-o/3.x
Browse files Browse the repository at this point in the history
fix: Parent modal not reopening after child modal is closed
  • Loading branch information
danharrin authored Sep 12, 2024
2 parents a56fc5e + fadeb66 commit b4b6e1c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/forms/src/Concerns/HasFormComponentActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,7 @@ public function unmountFormComponentAction(bool $shouldCancelParentActions = tru
}

if (! count($this->mountedFormComponentActions)) {
if ($shouldCloseModal) {
$this->closeFormComponentActionModal();
}
$this->closeFormComponentActionModal($shouldCloseModal);

return;
}
Expand All @@ -314,9 +312,11 @@ public function unmountFormComponentAction(bool $shouldCancelParentActions = tru
$this->openFormComponentActionModal();
}

protected function closeFormComponentActionModal(): void
protected function closeFormComponentActionModal(bool $shouldCloseModal = true): void
{
$this->dispatch('close-modal', id: "{$this->getId()}-form-component-action");
if ($shouldCloseModal) {
$this->dispatch('close-modal', id: "{$this->getId()}-form-component-action");
}

$this->dispatch('closed-form-component-action-modal', id: $this->getId());
}
Expand Down

0 comments on commit b4b6e1c

Please sign in to comment.