dsdevelopers wrote a comment+100 XP
3mos ago
@christogonus selectedOption becomes an object, not an array, after selection—so .length is undefined; use an object-safe check like:
wire:show="selectedOption.id"
dsdevelopers liked a comment+100 XP
3mos ago
@Weasel - mmm yeah I could see that. all wire: directives have always been JS actually. We just didn't really advertise that to avoid confusion like this. Most wire: directives are actually the equivalent Alpine directives under-the-hood (just with the scope of $wire provided automatically if that makes sense)
Good feedback that wasn't obvious to me though, thanks