-
Notifications
You must be signed in to change notification settings - Fork 58
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
Disable pan on initial zoom #44
Disable pan on initial zoom #44
Conversation
This looks great! I think this is a great idea. Could you please add a brief comment above the change, and update the README in this PR? Happy to approve and merge if so. |
Of course, I'll take care of it next week. Good input 👍 |
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.
Isn't disablePanOnInitialZoom
misleading since you can change initalZoom, but this feature always checks for zoomLevel === 1
?
Yeah, it probably is. Maybe something like |
@elliottkember README updated and code changes commented. What's your input in the prop naming mentioned by @janpe? |
Would it be difficult to change the logic to compare to the user selected initial zoom? If the user has set initialZoom to 1.5 it wouldn't make much sense to have this option disable panning at zoomLevel 1. But I guess of those two |
Sound perfectly reasonable, not a difficult change at all. Probably the better choice than renaming the prop. |
Comparing to Thank you both for the contribution!! |
@danielreuterwall when do you think you'll have time to make these changes? 😊 |
Thanks for the reminder :) Just pushed an update. |
@elliottkember when do you think this could be merged and released? I'd have use for this feature straight away 😁 |
guys can you please ship this feature on priority? It would great help. |
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.
LGTM!
is there any way to disable panning beyond edges also when zooming ? I am using disablePanOnInitialZoom but I want this behavior also when I zoom and get to edge of image. |
Added prop,
disablePanOnInitialZoom
, to control if pan is enabled when zoom level is 1.Another take would be to add a
panEnabled
prop to control this but I figured as this is a common request, a dedicated prop would be justified.Fixes #38