Value are blinking and missing in Filament Repeater
Sometimes I fill the value and click 'Add new item' immediately the values are missing in the input.
Solution:Jump to solution
Yes you use a loading view field. I made on in here so:
blade:
```html
@php...
26 Replies
We're having similar issues, IIRC it's probably because you're inputting faster than livewire can handle.
Think you need to add in ->lazy()
I don't think there is a fix for it, we tried everything and it's still happening on occasion.
You kind of have to live with it if you're using reactive/live fields.
That's working for me https://github.com/filamentphp/filament/issues/7571
So you want to use onblur really
This because it processes after the change and then you are not getting a refresh mid type
Yes.
Debounce does not solve it, it's just giving you more time until it happens.
Exactly as it's about form refresh, but onBlur sends it on actual click off that field
You coul also do afterStateValidated on the repeater and set the total and not have live inputs.
But sadly even with live(onBlur) if you switch between fields really fast it can still happen.
delete live()
here is my code. but I can't format the total_amout
Does the total amount get updated?
yeah
I set in here. Total amount is update without format.
Yes, but using the afterStateUpdated() function is really only a viable option if your form isn‘t that big. I‘m currently working on a form that is around +2k lines now and I need almost every value directly in my form too so adding ~50 afterStateUpdated() functions is currently not really an option. I guess I could implement it after the whole Resource is finished but atm it‘s not really an option.
Sorry, but it sounds like you are trying to force the wrong tech stack in to what you actually need for your use case.
I know, but I don‘t really have a choice atm. It‘s work related so I‘m forced to do it like this.
Fair but there’s limitations to the stack. There’s not always an answer to that.
Yeah I know, but right now it‘s working „fine“ so I guess we won‘t stray away from it. But I‘ll maybe look into MingleJS and see if I can get better reactivity using it with React/Vue.
While I‘m at it, is there like a guide or a good example project where a whole Filament page is made in React/Vue but it‘s still integrated into the normal Filament application (having the Filament sidebar, notifications etc.)? Or is that not even really possible?
If not, I‘ll maybe report back in 6-12 months on how implementing it using MingleJS worked out for us. 😂
Sounds good to me.
I have one more question tough, do you know if it‘s possible to show like a loading modal or something after a field has been filled out and live is triggered?
Something like this:
https://codepen.io/webhead/pen/WNoedWG
Solution
Yes you use a loading view field. I made on in here so:
blade:
Then in your form:
Oh my god, thanks for the help, really appreciate it!
I sent you a tip on PayPal :2frogheart:
Very welcome! The is fixed can be used like this too:
that usually allows a full screen coverage.
Thank you :D