Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phantom mouse down with selectFromInside #99

Closed
adela-almasan opened this issue Aug 30, 2022 · 5 comments
Closed

Phantom mouse down with selectFromInside #99

adela-almasan opened this issue Aug 30, 2022 · 5 comments
Labels
bug Something isn't working complete

Comments

@adela-almasan
Copy link

Environments

  • Framework name: React
  • Framework version: 17.0.2
  • Component name: Selecto (+Moveable)
  • Component version: 1.17.0

Description

phantom_mouse_down.mov

Hi! I'm using Selecto with selectFromInside disabled and since I disabled the option, it seems to have created a phantom mouse down issue, which can become an annoyance very quickly. I cannot replicate it on none of the sandboxes online and I was wondering if you might have an idea what could be the issue in this case.

^ Attached you can find a screencast of the issue - I'm never holding down the mouse for a proper drag, the elements are just following my mouse.

this.selecto = new Selecto({
   container: this.div,
   rootContainer: this.div,
   selectableTargets: targetElements,
   toggleContinueSelect: 'shift',
   selectFromInside: false,
});
@daybrush daybrush added the bug Something isn't working label Aug 30, 2022
@daybrush
Copy link
Owner

daybrush commented Aug 30, 2022

@adela-almasan

I'll fix it soon. Thank you :)

@daybrush
Copy link
Owner

@adela-almasan
selecto's new version is released. data event property is added.

The dragEnd event occurs earlier than when the moveable.dragStart method is called. If so, block dragStart like this:

.on("selectEnd", e => {
        if (e.isDragStart) {
            e.inputEvent.preventDefault();

            e.data.timer = setTimeout(() => {
                moveable.dragStart(e.inputEvent);
            }, 100);
        }
    }).on("dragEnd", e => {
        clearTimeout(e.data.timer);
    })

@adela-almasan
Copy link
Author

@daybrush That's perfect, thank you!

@adela-almasan
Copy link
Author

adela-almasan commented Sep 1, 2022

@daybrush After upgrading I'm having some issues with clickTarget in the existing code - selecto.clickTarget(event, div), attached you can find the console output. Would appreciate your input (datas -> data?). Thank you!

Screen Shot 2022-08-31 at 9 29 58 PM

Screen Shot 2022-08-31 at 9 31 27 PM

daybrush added a commit that referenced this issue Sep 1, 2022
@daybrush
Copy link
Owner

daybrush commented Sep 1, 2022

@adela-almasan

selecto's new version is released. Check it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working complete
Projects
None yet
Development

No branches or pull requests

2 participants