Topic: Dragging a thumbnail starts an image drag instead of moving its card

pineStack free asked 1 week ago


Our sortable cards contain a thumbnail link and some text. Dragging the empty part of a card moves it as expected, but starting on the thumbnail produces the browser's image preview and the card stays in place.

There are no custom dragstart handlers. Can the image's native drag behavior interfere with the sortable interaction, and can it be disabled without making the link unclickable?


Igor Przybysz staff answered 6 days ago


Images and links can provide their own native browser drag behavior. First test with draggable="false" on the thumbnail image and its wrapping link while leaving the normal href in place. That removes their native drag initiation without removing the link's ordinary click behavior.

For cards with several interactive controls, a dedicated drag handle can make the interaction clearer. If disabling native thumbnail dragging does not resolve the difference, please share one card's rendered HTML and the sortable initialization so we can check the event target and handle configuration.

<a href="/project/details" draggable="false">
  <img src="/images/project-preview.jpg" alt="Project preview" draggable="false">
</a>

https://mdbootstrap.com/docs/standard/plugins/drag-and-drop/



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: MDB5 9.3.0
  • Device: Desktop
  • Browser: Firefox
  • OS: Windows 11
  • Provided sample code: No
  • Provided link: No