fix: reset image viewer grabbed state when mouse is released#12226
Conversation
|
@mdneyazahmad The changes look fine, I'll test them all platforms by tomorrow. Quick confirmation on the web video, I hope you're not leaving the mouse cursor here? While dragging the pointer outside the container? I can't make out from the video. |
@mdneyazahmad Waiting for the confirmation as the solution doesn't work for me. Here's the attached video on web. image-drag-outside-container.mp4 |
|
@mananjadhav it is not very clear from the video. Could you list the steps? |
|
@mdneyazahmad The same reproduction steps from the issue.
|
|
@mananjadhav I believe that is expected, and that is reason The original issue is different. When you leave the mouse outside image view. The image is draggable without holding the mouse button. |
With your fix the image is not draggable if I leave the mouse pointer. Got it, you're right. I checked the original GH issue description and we're talking about leaving the mouse pointer outside the container. |
|
Changes look fine and test well. Thanks the explanation @mdneyazahmad. @roryabraham All yours 🎀 👀 🎀
ScreenshotsWebweb-attachment-drag.movMobile Web - ChromeThis isn't relevant for mWeb mweb-chrome-attachment-drag.movMobile Web - SafariThis isn't relevant for mWeb mweb-safari-attachment-drag.movDesktopdesktop-attachment-drag.moviOSios-attachment-drag.movAndroidandroid-attachment-drag.mov |
|
@roryabraham Quick bump on this. |
|
@roryabraham Did you get a chance to look at this PR? |
roryabraham
left a comment
There was a problem hiding this comment.
LGTM, sorry for the long delay on the review
|
@roryabraham looks like this was merged without the checklist test passing. Please add a note explaining why this was done and remove the |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by @roryabraham in version: 1.2.28-0 🚀
|
|
🚀 Deployed to staging by @roryabraham in version: 1.2.28-0 🚀
|
|
🚀 Deployed to production by @roryabraham in version: 1.2.28-2 🚀
|
Details
While dragging the image in a modal, when the cursor is released outside image view, the state of the cursor is not reset, and the image is draggable with just mouse move. This PR fixes this issue by tracking the cursor position and resetting the grabbed state when that is released outside the image view.
Note: This PR does not touch the native files, i.e., no change for native platform (iOS and android).
Fixed Issues
$ #11192
PROPOSAL: #11192 (comment)
Tests
QA Steps
PR Review Checklist
PR Author Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarhave been tested & I retested again)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)Screenshots
Web
web.mp4
Mobile Web - Chrome
mweb-chrome.mp4
Mobile Web - Safari
mweb-safari.mp4
Desktop
desktop.mp4
iOS
ios.mp4
Android
android.mp4