Every time a field in the model changes, a request is sent to the server with the changes in the component. This is crazy behavior. Why is this done? Why aren't changes being processed on the client side?
Example: user model. I write an email address and when you enter each character, a request is sent to the server. The length of the email address is 24 characters - 24 requests were sent to the server.
How can I disable this?
Every time a field in the model changes, a request is sent to the server with the changes in the component. This is crazy behavior. Why is this done? Why aren't changes being processed on the client side?
This is by design and how Livewire works when you bind an input
field with a component
property
.
How can I disable this?
There are a few options available to you:
debounce
value which by default is set to 150ms
.<input type="text" wire:model.debounce.500ms="name">
change
event has been fired (user clicks away).<input type="text" wire:model.lazy="message">
<input type="text" wire:model.defer="query">
<button wire:click="search">Search</button>