F
Filament2mo ago
Eskie

Data remove when trigger `->live(debounce: 500)`

I have these 3 fields: gross amount, discount amount and total amount.. after i put a value on gross amount and suddenly change field to discount amount when i put a value in it what will happen is that the value will be removed(due to server request of live function).. is there any to prevent this? calculation is kinda slow..
1 Reply
awcodes
awcodes2mo ago
if you don't need the server to do the calculation then you can do it all client side with the afterStateUpdatedJs() method. https://filamentphp.com/docs/4.x/forms/overview#preventing-the-livewire-component-from-rendering-after-a-field-is-updated

Did you find this page helpful?