Image Button
- [x] I have searched to see if a similar issue already exists.
Is your feature request related to a problem? Please describe.
As a workaround for the issue described in #1976 (there is currently no way, afaik, to get the selected image in a Gallery), I thought that a potential solution could be a special Button whose content is not a label, but an image.
Describe the solution you'd like
It could be an output Component so it can be used as the target of some function. Clicking it would invoke an user-defined function, as usual.
Additional context
This can probably be achieved using Image.click (I'll test it right now). Still, using a Button could be simpler and it could also bring a more "buttony" visual style so the user knows the item can be interacted with.
Thanks for the suggestion. Image doesn't actually support click(), so this is something that we would have to implement separately. We'll need to think about how to design a good UI for a button with an image. If you've seen a good implementation of a button with an image anywhere on the web, feel free to link to it for inspiration!
We'll need to think about how to design a good UI for a button with an image. If you've seen a good implementation of a button with an image anywhere on the web, feel free to link to it for inspiration!
Good point. I'm not sure. An initial approach could be to mimic the current look of images inside a Gallery, which have rounded corners and a nice hover behaviour with a brightness layer and a border. Perhaps we could try an unfocused state with a lighter border and the same hover animation.
That'd be already much better than my current workaround to use a button or a radio button below the image :)
It is now possible to .select() an image in the Gallery component, so I'll go ahead and close this. Thanks @pcuenca!