Skip to content

Issue with closeModalWithEvents() #325

Closed

Description

@michaeljhopkins

I have this code in a modal

class EditAuthorizedUser extends ModalComponent {
    public function submit() {
        $this->closeModalWithEvents(['authorizedUsersUpdated']);
    }
}

and

class AuthorizedUsers extends Component {
    protected $listeners = ['authorizedUsersUpdated' => '$refresh'];
    public function render() {
        return view('view.file');
    }
}

When I close the modal I only see these events. What am I missing to make this method work?
Screenshot 2023-06-08 at 1 27 02 PM

Activity

  1. feliperafael commented on Jun 19, 2023

    @feliperafael

    I'm having the same issue. When I close the modal the event doesn't seem to fire. Did you get any solution?

  2. lrljoe commented on Jul 22, 2023

    @lrljoe

    Disable the destruction of the component.

    It is destroying it before the event queue (internal to the component) has had a chance to run.
    In the config file, ensure its set to:

            'destroy_on_close' => false,
    
  3. locked and limited conversation to collaborators on Sep 8, 2023
  4. converted this issue into a discussion #356 on Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions