Aug 1, 2021
0
Level 3
Livewire js hooks
hi guys. There is a way, on livewire javascript hooks stop or prevent the execution of a message.sent event or the DOM result of if??? eg.
Livewire.hook('message.sent', (message,component) => {
if (message.updateQueue[0].method === 'openEditConnectionModal') {
if (($('#editConnectionModal').data('bs.modal') || {})._isShown )
// if the modal is already open, trash, delete or avoid this event
}
});
the thing is I have a table and in data's rows click open a modal to edit selected item. But if immediately to click one, you click in other row, this last click function will be executed after the first with the modal opened, and will be crash. That's why I'm trying to get this event before DOM update and cancel it if the modal is already open. Could you give me a hint on this?
Please or to participate in this conversation.