selecto icon indicating copy to clipboard operation
selecto copied to clipboard

What would be the best approach to make buttons or other interactive elements available on selectable elements

Open Arjanno opened this issue 2 years ago • 2 comments

Environments

  • Framework name: react
  • Framework version: react 18.2.0
  • Component name: selecto
  • Component version: 1.18.2
  • Testable Address(optional):

Description

I have draggable elements that also contain buttons. Currently Selecto intercepts all mouse-clicks. Is there a way to have a higher zIndex or something like the checkinput hack to solve that the buttons have higher priority as Selecto?

Arjanno avatar Sep 13 '22 04:09 Arjanno

@Arjanno

It is not blocking the click, but blocking the drag.

In the dragStart event, if the target is a button, call stop().


onDragStart={e => {
   if (e.inputEvent.target.tagName === "BUTTON") {
      e.stop();
   }
}}

daybrush avatar Sep 13 '22 04:09 daybrush

Awesome! That solved my problem.

Arjanno avatar Sep 13 '22 08:09 Arjanno