daybrush / selecto

Selecto.js is a component that allows you to select elements in the drag area using the mouse or touch.
https://daybrush.com/selecto
MIT License
2.04k stars 82 forks source link

Bug: `toggleContinueSelect` & `toggleContinueSelectWithoutDeselect` #116

Closed SidIcarus closed 1 year ago

SidIcarus commented 1 year ago

Environments

Description

Use case 1:

Use case 2:

I've seen your suggestion in #97; enabling toggleContinueSelectWithoutDeselect with the same value as toggleContinueSelect resolves the problems above but then I am unable to deselect elements using that same key.

Would you have any suggestions on how to go about resolving the above?

Note: I have resolved the inverse of Use case 2 (parent is first selected then children are attempted to be selected using toggleContinueSelect) in the link I provided.

daybrush commented 1 year ago

@SidIcarus

thanks.

daybrush commented 1 year ago

@SidIcarus

you can check by isTrusted event property in Moveable (0.43.1)

Moveable


<Moveable 
      onClick={e => {
          if (e.isTrusted) {
              selecto.clickTarget(e.inputEvent, e.inputTarget);
          }
      }}
      onClickGroup={e => {
          if (e.isTrusted) {
              selecto.clickTarget(e.inputEvent, e.moveableTarget);
          }
      }}
/>
SidIcarus commented 1 year ago

Thank you!