Calling a livewire method via the blur event (javascript)

Guys,
I need to call a livewire event when I lose focus (blur).
How could I do this?

When I exit an input I want to save the text.

Hey, @mflorindo

You can do something like this:

<input id="name" type="text"/>

<script>
  let input = document.getElementById('name');

 input.addEventListener('blur', () => {
    @this.dispatch('your-event-name');
});
</script>

PS: I don’t test this code, it may a typo in it or something.

I think you can use wire:model.lazy=input” and in the component you can use updatedInput and do the logic there