Gallery with <a> element in caption causes extra navigation clicks/swipes
Closed this issue · 7 comments
When I add an element to a caption an extra navigation click is added between the slide with the caption and whatever is next in the gallery.
Here a gallery with an attribution link in the first caption that is adding a click
Is there a way to limit navigation to only the first per gallery item?
Hmmm, this isn't a behavior we've seen before. Your theme is bundling a few JS libraries that may be causing this behavior. Do you experience this when using a default WordPress theme?
Here is the same gallery on a copy of the site running Twenty Fifteen with no plugins other than WP-Featherlight. I'm getting the same extra click in the navigation.
Whoops, that was an accidental close...
@ryandonsullivan
I found this support thread in which a user suggests replacing ".gallery-item a"
with "a[data-featherlight='image']"
I tried this and it resolves the extra click that was happening when buildGalleries
adds every a
to $galleryItems
including any present in captions
In case it's useful, I've submitted a pull request. Wasn't able to minify, though.
This should be fixed in the next release. If you're able, please test our development branch and let me know if the problem has been taken care of.
@robneu
Thanks! I've installed the development branch on a copy of the site and the gallery navigation now works as expected.
Fantastic! It looks like we may need to apply some styling to links in captions as well.