Visual Inconsistencies in Filament Repeater with Dynamic Select Options
We are using a Filament form with a Repeater that contains a Select field to choose workers from the User model, filtered by the Employee role. The requirement is that once a worker is selected in one row, they should not appear in the Select options of other rows.
Issue: When selecting a worker, the selected worker's name visually jumps to the next available ID after about half a second. However, the originally selected worker does disappear from the list, indicating that the selection is correctly registered but not correctly displayed.
Due to the character limit, I will share another thing I tried in the comments
Question:
Am I doing something wrong, or is this a bug in the Filament framework? Any assistance or suggestions on how to handle this scenario correctly would be greatly appreciated.
2 Replies
Issue: This code resolves the initial jumping issue but introduces another problem: changing the first worker to another (especially if their ID is one higher than the last selected) causes all rows below it to display the changed worker’s name. Adding or removing a row triggers a refresh that corrects the names, but this is confusing and undesired.
Summary of Approaches Tried:
Direct Filtering in
options
Callback:
Issue: Selected worker names visually jumped to the next available ID.
Real-Time Updates with afterStateUpdated
:
Issue: Introduced extra rows and visual inconsistencies.
Combining with live Option for Real-Time Changes:
Issue: Multiple re-renders led to flickering and incorrect visual updates.any update for this one?