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

How to set the default selected value ? #133

Closed xian107 closed 1 year ago

xian107 commented 1 year ago

For example: <Selecto defaultSelects={[{dom}]} />

daybrush commented 1 year ago

@xian107

Not yet configurable via props. It can be set via ref.

useEffect(() => {
   selectoRef.current.setSelectedTargets([target1, target2]);
}, []);

<Selecto
   ref={selectoRef}
/>