fix(image-card): render as div if no href is provided #515
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #514
Currently unless you add the
disabled
prop, anImageCard
will always render as an anchor.This is problematic if you don't also provide an
href
(which is not a required prop, either).Recently on the IBM Security design team, we've come across a situation where we want the positioning and styling of an
ImageCard
within a grid, but we don't need to link it anywhere. (So, we aren't providing anhref
). TheImageGalleryCard
would not apply well for our designs/situation., and we also don't want to applydisabled={true}
toImageCard
which would apply "do not click" cursor + icon + give an impression that the Card would be clickable under other circumstances. So we wanted to propose a fix here.Please let me know what you think -- thanks!
Changelog
Changed
bx--tile--clickable
class ifhref === undefined
(for hover effects on links only, etc)ImageCard
as adiv
ifhref === undefined