Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add onSelect event listener? #12

Open
StringKe opened this issue May 13, 2021 · 2 comments
Open

How to add onSelect event listener? #12

StringKe opened this issue May 13, 2021 · 2 comments

Comments

@StringKe
Copy link

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
Copy link
Author

@daybrush Can you check this error? Thank you

@StringKe
Copy link
Author

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant