Skip to content

Commit

Permalink
Merge pull request #3 from laurenashpole/fix/ipad_main_image
Browse files Browse the repository at this point in the history
Fix for image disappearing on zoom out on touch devices
  • Loading branch information
laurenashpole authored Dec 30, 2020
2 parents f0b1205 + ebc752f commit 7b9faeb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions demo/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<div>
<h2>Drag Example</h2>
<inner-image-zoom
src="/assets/unsplash.jpg"
zoomSrc="/assets/unsplash-large.jpg"
src="/assets/unsplash2.jpg"
zoomSrc="/assets/unsplash2-large.jpg"
moveType="drag"
:fullscreenOnMobile="true"
/>
Expand Down
6 changes: 4 additions & 2 deletions src/InnerImageZoom/InnerImageZoom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@

<button
v-if="this.isTouch"
type="button"
class="iiz__btn iiz__close"
aria-label="Zoom Out"
v-bind:class="{ 'iiz__close--visible': isZoomed }"
Expand All @@ -91,7 +92,7 @@
this.isFullscreen ? 0 : fadeDuration
}ms visibility`
}"
v-on:click="handleClose"
v-on:click.stop="handleClose"
/>
</div>
</MountingPortal>
Expand Down Expand Up @@ -122,14 +123,15 @@
<button
v-if="this.isTouch"
class="iiz__btn iiz__close"
type="button"
aria-label="Zoom Out"
v-bind:class="{ 'iiz__close--visible': isZoomed }"
v-bind:style="{
transition: `linear ${this.isFullscreen ? 0 : fadeDuration}ms opacity, linear ${
this.isFullscreen ? 0 : fadeDuration
}ms visibility`
}"
v-on:click="handleClose"
v-on:click.stop="handleClose"
/>
</template>
</template>
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('InnerImageZoom', () => {
left: 0,
bottom: 0,
right: 0
}
};
});
});

Expand Down

0 comments on commit 7b9faeb

Please sign in to comment.