scena icon indicating copy to clipboard operation
scena copied to clipboard

How to add onSelect event listener?

Open StringKe opened this issue 4 years ago • 2 comments

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,
  });
}}

image

StringKe avatar May 13 '21 09:05 StringKe

@daybrush Can you check this error? Thank you

StringKe avatar May 20 '21 08:05 StringKe

https://github.com/daybrush/dragscroll/blob/master/src/DragScroll.ts#L53

If add selectedTargets to targets in moveable, startRect in DragScroll is always empty.

StringKe avatar May 20 '21 08:05 StringKe