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

Demo/move resize items moves timeline when item close to left right border #875

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

davidbejarcaceres
Copy link

Issue

Solution for issue #783.
Use the moveResizeValidator() function to move/resize an item close to the left/right border of the timeline, and auto scroll the timeline bounds to the direction of the move/resize item. By doing this you can keep moving/resizing the item without to stop, move timeline and move/resize again and item.

Overview of PR

  • Item.js function this.props.moveResizeValidator() will have the same params for move and resize (action, item, time, resizeEdge, event, this.state.dragStart).
  • Demo "Move/Resize item close to left/right border, auto scroll timeline" (scrollCloseToBorders) in "demo/app/demo-scroll-close-to-borders/index.js".
  • CodeSandbox demo.

Move item left/right
Here you can see the functionality to auto scroll timeline when move item close to left/right borders:

React-Calendar-Timeline.Move.mp4

Resize edges of item left/right
Now for resize item close to left/right borders:

React-Calendar-Timeline.Resize.mp4

Check tests passed
Yes, no errors when running yarn run test, no many changes to library itself, just extra params to the moveResizeValidator function in Iitem.js.

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

Successfully merging this pull request may close these issues.

1 participant