fix: Right-click causes image drag on ModalMediaPreviewCarousel#3265
Open
Christopher-Hayes wants to merge 1 commit intoelk-zone:mainfrom
Open
fix: Right-click causes image drag on ModalMediaPreviewCarousel#3265Christopher-Hayes wants to merge 1 commit intoelk-zone:mainfrom
Christopher-Hayes wants to merge 1 commit intoelk-zone:mainfrom
Conversation
✅ Deploy Preview for elk-zone ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for elk-docs canceled.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a drag on the image preview (the "modal media preview carousel") begins, check if the mouse right-click button is down. If it is down, prevent the carousel drag behavior.
This is to fix the issue where you right-click on an image to show the browser right-click menu, but the carousel thinks you're now dragging the carousel.
Videos
The video below first shows the bug on the current stable build. And then it shows the behavior on the dev build with the new code. The image is no longer dragged on right-click.
Screencast.From.2025-04-14.14-59-51.mp4
Fixes #3264
Misc Notes
Vertical dragging should probably be supressed, as well as dragging when there is only a single media component. But, to keep this PR focused, I did not try to fix those UX quirks.