Change filament html element class definition dynamically
Hi. Check this SO post if possible: https://stackoverflow.com/questions/78803565/filament-add-extra-class-to-the-html-element-dynamically
I have a FileElement and I would like to add a class to it dynamically based on some properties. For example, take this piece of code:
What happens is that the extraAttributes method gets invoked when I change the FileUpload data in the form, however it does not update. It initially renders with the class that matches the logic, but if that changes, it does not add/remove any other classes. It's like the class property of the html element is only set during the first render, and any other changes to it are ignored. Is there anything I could do about it?
I have a FileElement and I would like to add a class to it dynamically based on some properties. For example, take this piece of code:
What happens is that the extraAttributes method gets invoked when I change the FileUpload data in the form, however it does not update. It initially renders with the class that matches the logic, but if that changes, it does not add/remove any other classes. It's like the class property of the html element is only set during the first render, and any other changes to it are ignored. Is there anything I could do about it?
Stack Overflow
I have a FileElement and I would like to add a class to it dynamically based on some properties. For example, take this piece of code:
public static function makeImageFileUpload(
string $name,
...
public static function makeImageFileUpload(
string $name,
...