Conditional hidden field with javascript

Hi I have a field with conditional hidden property
->hidden(fn (Get $get): bool => $get('video_type') != 'file')
->hidden(fn (Get $get): bool => $get('video_type') != 'file')
This is a custom field which need javascript to render the field correctly But the javascript never runs
5 Replies
Dennis Koch
Dennis Koch2d ago
Maybe share your field implementation
Mohamed Hesham
Sure
No description
Mohamed Hesham
When I use it without hidden the javascript works
Dennis Koch
Dennis Koch2d ago
Do you really need that hidden element? Not sure whether Alpine can bind to hidden 🤔
Mohamed Hesham
Mohamed Hesham18h ago
Yes, I need to select where the video is file or a youtube link I did an ugly solution I added a class inside the input called render-me And ran setInterval each 1 second The function renders the input with class render-me then removes that class It worked
Want results from more Discord servers?
Add your server