-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(gatsby-remark-images): remove clickable whitespace around image when linking #11528
fix(gatsby-remark-images): remove clickable whitespace around image when linking #11528
Conversation
@ajschmidt8 can you allow permission to push to your branch? https://help.github.com/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/
|
@DSchau, done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the general idea here that we don't want the extra space surrounding the image to be clickable?
I'm not really sure which behavior is preferable--could you provide why it's advantageous one way or the other?
@DSchau yes, that is the idea. The screenshots above are from a page on a site that I'm building. As indicated in the pictures, if you click in the whitespace surrounding the image, it will open the original image in a new URL. I found this to be kind of an annoyance. I thought it would be better if the original image only opened when the actual thumbnail was clicked and not the surrounding whitespace. |
It seems like it would be misleading to users if they clicked whitespace and an image popped up. |
…by into topics/fix-remark-images
@DSchau, just pulled the latest and fixed some merge conflicts. let me know if this can be merged soon 😬 |
@ajschmidt8 Could you allow me to push to your repo so that I can merge the conflicts? |
@freiksenet i just resolved the conflicts and pushed the changes 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay! Thank you for working on this.
Holy buckets, @ajschmidt8 — we just merged your PR to Gatsby! 💪💜 Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! |
Published in |
This PR changes the way that
gatsby-remark-images
handles linking image thumbnails to their originals.Behavior Before PR
Currently, the
a
tag that links to the original image expands to fill the entire parent.Behavior After PR
The new behavior makes the link only contain the image and not any extra whitespace.
The Jest snapshots for this package were updated to reflect this change.