scena
scena copied to clipboard
How to add onSelect event listener?
Thank you for providing great open source components. I encountered some errors while trying to customize some functions. Can you tell me how to solve the errors?
https://github.com/daybrush/scena/blob/master/packages/react-editor/src/Editor/Editor.tsx#L274
Editor will pass selectedTargets to moveable property target in MoveableManager,I tried to add an event, but the Selecto component generates an error.
onScroll={({ direction }) => {
infiniteViewer.current?.scrollBy(
direction[0] * 10,
direction[1] * 10
);
}}
onSelect={(e) => {
this.setState({
selectedTargets: e.selected,
});
}}

@daybrush Can you check this error? Thank you
https://github.com/daybrush/dragscroll/blob/master/src/DragScroll.ts#L53
If add selectedTargets to targets in moveable, startRect in DragScroll is always empty.