Unable to Select Text Within Draggable Elements

Author: VituliCreated Feb 24, 2025Updated May 5, 2025
Labelsuntriagedunconfirmed-bug

Expected behavior

Text inside draggable elements should be selectable for copy without interfering with drag functionality.

Actual behavior

Text within draggable elements is not selectable because the library captures mouse events for dragging, preventing text selection.

Steps to reproduce

  1. Create a draggable element using Draggable from react-beautiful-dnd.
  2. Add a text element inside the draggable element.
  3. Attempt to select the text using the mouse.
  4. Notice that the text cannot be selected because the drag event is triggered.

Suggested solution?

Add a prop like allowTextSelection or provide a built-in way to allow text selection within draggable elements without needing to manually stop propagation.

Current workaround:

javascript
<Draggable draggableId="item-1" index={0}>
  {(provided) => (
    <div ref={provided.innerRef} {...provided.draggableProps} {...provided.dragHandleProps}>
      <span onMouseDown={(e) => e.stopPropagation()}>Selectable Text</span>
    </div>
  )}
</Draggable>

Source: atlassian/react-beautiful-dnd