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
2k stars 81 forks source link

some types are any #124

Open jonlepage opened 1 year ago

jonlepage commented 1 year ago

some type are any and can be identifier this one should be MouseEvent or PointerEvent | MouseEvent image image

data and datas seem also missing type, we code blind with any :)

edit


for datas , it would be nice if we can get the type. Scenario of usage can be when we want prevent drag on right click, keep select behavior and call a context menue by passing selections. image

Solution can be also expose current list if it possible: it seem we need manually check dom elements with class selected, idk if you have any idea to expose a precomputed store of the selected list somewhere? maybe in a weakMap or weakSet of you scare about memleak but with some little perf cost for huge list. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap

image