daybrush / scena

🎬 Scena is a component that represents the timeline of Scene.js. You can control time, properties, and items.

Home Page:https://daybrush.com/scena

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to add onSelect event listener?

StringKe opened this issue · 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

@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.