Skip to content

Dragging work on the responsive preview but doesn't in the desktop view #341

Discussion options

You must be logged in to vote

Got it working by adding draggable={false} in the img attributes:

<img src={imageSrc} 
      ref={imageRef}
      draggable={false}`
      style={{
        transform: `translate(${x}px, ${y}px)`
      }}
      className="image-pan" />

Wild guess is that the browser default to dragable to true, but that actually means that you can drag a semi-transparent copy of that image under the cursor. but there is nowhere to drop that image hence the cursor-cancel. And it work with the mobile preview since in that case the dragable default to false ? I would be curious to a have the full explanation if anyone knows.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@dbismut
Comment options

@GuillaumeTech
Comment options

Answer selected by GuillaumeTech
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants