Skip to content
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

Change zoomed image margin #139

Closed
babyPrince opened this issue Oct 24, 2018 · 5 comments · Fixed by #140
Closed

Change zoomed image margin #139

babyPrince opened this issue Oct 24, 2018 · 5 comments · Fixed by #140

Comments

@babyPrince
Copy link

Hey there, Thank you for the great component!

I'm having issue adjusting the maximum space around the zoomed image. Currently is something like 45px top bottom, what would be the way to adjust those margins? I've tried zoomMargin but it's making the image really small in the centre of the screen when clicked, using:

<ImageZoom
  defaultStyles={{
    overlay: {
      backgroundColor: 'none',
    }
  }}
  zoomMargin="0"

Thanks

@rpearce
Copy link
Owner

rpearce commented Oct 24, 2018

Hi @babyPrince, thank you for using the component and for asking your question – let's get you sorted! I'm looking into this now. Standby...

@rpearce
Copy link
Owner

rpearce commented Oct 24, 2018

@babyPrince, you've pointed out a small issue that's not quite intuitive: String vs Number. Here's a picture of the docs:
image
As you can see, it's a Number type that's expected, but you're sending a string. It should be able t handle both, though. I'll write up an issue, fix it and add you to the all contributors list!

If you want to fix your issue immediately, change zoomMargin="0" to zoomMargin={0}.

@rpearce rpearce closed this as completed Oct 24, 2018
@rpearce rpearce reopened this Oct 24, 2018
@rpearce
Copy link
Owner

rpearce commented Oct 24, 2018

On second thought, I'll use this issue for issue tracking 🤦‍♂️

@rpearce
Copy link
Owner

rpearce commented Oct 24, 2018

@babyPrince the fix has been published in v3.0.15, and you have been added to the all contributors list. Thanks for the bug report!

@babyPrince
Copy link
Author

Hey @rpearce Thank you for the reply. Was reading about the number in the docs, but the whole time didn't hit me I was passing a string!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants