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

Compatibility about windowing technique #18

Open ozsirma opened 3 years ago

ozsirma commented 3 years ago

Environments

Description

Firstly, thank you for this library. I am using react-window. Selecto runs querySelectorAll method for selectableTargets only during onDragStart. For windowing, is it possible re-find selectableTargets during onDrag ? Could a more logical piece of code be written for this use ?

daybrush commented 3 years ago

@ozsirma

Let me investigate. I'll probably make it possible through a method.

ozsirma commented 3 years ago

Is there any progress on the feature ?

daybrush commented 3 years ago

@ozsirma

I couldn't manage because I was driven by a schedule. Now start working.

daybrush commented 3 years ago

@ozsirma

selecto new version is released. Check it again. Use findSelectableTargets method

ozsirma commented 3 years ago

Hi @daybrush findSelectableTargets is called in onDragStart. Could there be a mistake here ?

daybrush commented 3 years ago

@ozsirma

you can use findSelectableTargets in onDrag

ozsirma commented 3 years ago

@ozsirma

you can use findSelectableTargets in onDrag

How I can use findSelectableTargets during in onDrag for react-selecto ? Can you give me an example ?

mcunningham commented 3 years ago

@ozsirma I am also interested in using react-selecto with react window or another windowing technique. Did you find a solution for this?

ozsirma commented 3 years ago

@mcunningham I could not find any technique. As a workaround, after onDragEnd I calculate the unselected fields and mark them as selected.

daybrush commented 3 years ago

@ozsirma @mcunningham

onDrag={(e) => {
    // re find selectable targets during dragging.
    selecto.findSelectableTargets();
}}