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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mobile event on input vicp-range #268

Open
pasestars opened this issue Jan 5, 2023 · 1 comment
Open

Add mobile event on input vicp-range #268

pasestars opened this issue Jan 5, 2023 · 1 comment

Comments

@pasestars
Copy link

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/vue-image-crop-upload/upload-3.vue b/node_modules/vue-image-crop-upload/upload-3.vue
index 2f20c30..e78d952 100644
--- a/node_modules/vue-image-crop-upload/upload-3.vue
+++ b/node_modules/vue-image-crop-upload/upload-3.vue
@@ -50,9 +50,9 @@
 					</div>
 
 					<div class="vicp-range">
-						<input type="range" v-model="scale.range" step="1" min="0" max="100" @mousemove="zoomChange">
-						<i @mousedown="startZoomSub" @mouseout="endZoomSub" @mouseup="endZoomSub" class="vicp-icon5"></i>
-						<i @mousedown="startZoomAdd" @mouseout="endZoomAdd" @mouseup="endZoomAdd" class="vicp-icon6"></i>
+						<input type="range" v-model="scale.range" step="1" min="0" max="100" @mousemove="zoomChange" @touchmove="zoomChange" @touchend="zoomChange">
+						<i @mousedown="startZoomSub" @mouseout="endZoomSub" @mouseup="endZoomSub" @touchstart="startZoomSub" @touchmove="endZoomSub" @touchend="endZoomSub" class="vicp-icon5"></i>
+						<i @mousedown="startZoomAdd" @mouseout="endZoomAdd" @mouseup="endZoomAdd" @touchstart="startZoomAdd" @touchmove="endZoomAdd" @touchend="endZoomAdd" class="vicp-icon6"></i>
 					</div>
 
 					<div class="vicp-rotate" v-if="!noRotate">

This issue body was partially generated by patch-package.

@lupinitylabs
Copy link

lupinitylabs commented Feb 11, 2023

It is also possible to just use the @input in place of the @mousemove, worked for me on both desktop and mobile, in both Webkit and Firefox. I would contribute a PR, but I have my doubts this project is still actively supported...?

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

No branches or pull requests

2 participants