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

onDragEvent vertical scrolling #174

Open
Salmankhan033 opened this issue Mar 16, 2022 · 33 comments
Open

onDragEvent vertical scrolling #174

Salmankhan033 opened this issue Mar 16, 2022 · 33 comments
Labels
status: in progress type: feature enhancements or new features

Comments

@Salmankhan033
Copy link

When I drag the event then the vertical/horizontal scrolling not working.
How to enable vertical scrolling when dragging or dropping events?

@pdpino
Copy link
Collaborator

pdpino commented Mar 16, 2022

Something like:

  • Week-view shows in the screen between 8am and 10pm
  • User starts dragging an event from 6pm (and wants to drop at 6am)
  • User drags the event up (or down) until the end of the screen
  • The agenda should scroll vertically, while the user still does not drop the event, to allow dropping the event at 6am

Is this what you want?

I'm working on improving the overall drag and drop, fixing bugs and making it smoother. I'll try to consider this as well

@pdpino pdpino added the type: feature enhancements or new features label Mar 16, 2022
@Salmankhan033
Copy link
Author

If one person changes their event from 6 pm to 6 am then how it will scroll the screen to drag and drop events directly?

@Salmankhan033
Copy link
Author

Salmankhan033 commented Mar 16, 2022

can you show me the code from where you false the scroll?

@pdpino
Copy link
Collaborator

pdpino commented Mar 16, 2022

@Salmankhan033 I think I'm not understanding correctly.

  1. about your question

can you show me the code from where you false the scroll?

In our code we do not disable the vertical or horizontal scrolling while an event is being dragged. The behavior is a result of how Views work.

  1. Can you please confirm if you meant something like this? (example with google calendar). If the answer is no, please provide a visual example

demo-vertical-scroll

  • Week-view shows agenda between 12pm and 12am
  • User starts dragging an event from 6pm (and wants to drop at 6am)
  • User drags the event up until the end of the screen
  • The agenda should scroll vertically, while the user still does not drop the event, to allow dropping the event at 6am

@Salmankhan033
Copy link
Author

@Salmankhan033 I think I'm not understanding correctly.

  1. about your question

can you show me the code from where you false the scroll?

In our code we do not disable the vertical or horizontal scrolling while an event is being dragged. The behavior is a result of how Views work.

  1. Can you please confirm if you meant something like this? (example with google calendar). If the answer is no, please provide a visual example

demo-vertical-scroll

  • Week-view shows agenda between 12pm and 12am
  • User starts dragging an event from 6pm (and wants to drop at 6am)
  • User drags the event up until the end of the screen
  • The agenda should scroll vertically, while the user still does not drop the event, to allow dropping the event at 6am

Yes, I want such a type of scrolling when dragging the event.
how i will implement it in your calendar?

@pdpino
Copy link
Collaborator

pdpino commented Mar 17, 2022

how i will implement it in your calendar?

Cannot be done with the current code, AFAIK.
We will try to add it, after PR #175 with new libraries

@pdpino pdpino added the status: on hold Not addressed yet or waiting other issue label Apr 25, 2022
@TheTushar2696
Copy link

@pdpino Any update on this feature

@pdpino
Copy link
Collaborator

pdpino commented Jul 6, 2022

@TheTushar2696 I'm not currently working on this

@TheTushar2696
Copy link

Hi @pdpino
Any plans of picking it up in the near future?

@Salmankhan033
Copy link
Author

I have done it
By long press on events and copy it.
Then place/past it in your specific place

Hi @pdpino Any plans of picking it up in the near future?

@TheTushar2696
Copy link

TheTushar2696 commented Jul 6, 2022

I have done it By long press on events and copy it. Then place/past it in your specific place

Hi @pdpino Any plans of picking it up in the near future?

Hi,
Didn't get the approach, request you to please elaborate a bit on this

@TheTushar2696
Copy link

@Salmankhan033 ^^

@Salmankhan033
Copy link
Author

I have done it By long press on events and copy it. Then place/past it in your specific place

Hi @pdpino Any plans of picking it up in the near future?

Hi, Didn't get the approach, request you to please elaborate a bit on this

onEventLongPress={(_event) => { setEditableEvent(_event) }

    then   onGridClick={(pressEvent, startHour, date) => {...}
    Then pass the date and editable events to API
    it will update the API

@TheTushar2696
Copy link

TheTushar2696 commented Jul 6, 2022

@Salmankhan033 Not sure how is this working, sorry to bother you but can you please share a working code snippet,
Does this makes the screen scroll as we drag the event?

Thanks in advance

@Salmankhan033
Copy link
Author

@Salmankhan033 Not sure how is this working, sorry to bother you but can you please share a working code snippet, Does this makes the screen scroll as we drag the event?

Thanks in advance

Yes sure.I can send you the code.
welcome

@pdpino
Copy link
Collaborator

pdpino commented Jul 7, 2022

Any plans of picking it up in the near future?

@TheTushar2696 yes. The main delay is that after some quick research I still do not know how to implement it

(though it should be possible with react-native-gesture-handler)

@pdpino pdpino added status: in progress and removed status: on hold Not addressed yet or waiting other issue labels Jul 10, 2022
@pdpino
Copy link
Collaborator

pdpino commented Jul 12, 2022

Update: I've been working on this. Have not been able to fully solve it, but I have this minimal example for now:

update-2022-07-12_10.45.16.mp4

(mainly using react-native-reanimated)

@TheTushar2696
Copy link

@pdpino , Thanks for the update, please lmk if there is any progress or you need any kind of help

@SwikarBhattarai
Copy link

any progress ? @pdpino
@TheTushar2696 did you find a solution?

@pdpino
Copy link
Collaborator

pdpino commented Aug 17, 2022

@SwikarBhattarai I'm stuck with this feature, any help is appreciated

I have a solution like the comment above:

  • the user drags an event to the (top or bottom) edge --> the view is scrolled by an offset
  • then, to scroll the view again, the user needs to drag the event again

We want something more natural, like the example from google calendar above:

  • the user drags an event to the edge --> the view is scrolled continuously, until the user drags the event away from the edge

@SwikarBhattarai
Copy link

SwikarBhattarai commented Aug 17, 2022

@pdpino can you share me your solution.

@pdpino
Copy link
Collaborator

pdpino commented Aug 17, 2022

@SwikarBhattarai or anyone else, lmk if you have any code or ideas on how to solve this with react-native-reanimated v2 (e.g. maybe other app that solves a similar problem)

@SwikarBhattarai
Copy link

@pdpino can you share me your current solution because its impossible to drag and drop from 6am to 6pm like situations.

@pdpino
Copy link
Collaborator

pdpino commented Aug 17, 2022

can you share me your solution.

@SwikarBhattarai do you want it for deployment? I'd have to clean some stuff and send a PR

If you want to develop, check this branch: https://github.com/pdpino/react-native-week-view/tree/feature/wip/174-drag-and-scroll

  • The drag-scrolling syncronization is implemented in src/context/DragEvent.js
  • the current solution is only implemented scrolling up. Implementing for scrolling down is analogous (but I want to fix the behavior first)
  • Note: the branch is ahead of master by a bunch of other features/fixes

@pdpino
Copy link
Collaborator

pdpino commented Aug 25, 2022

Here is a video of the current solution in branch https://github.com/pdpino/react-native-week-view/tree/feature/wip/174-drag-and-scroll:

update-wv-2022-08-25_09.51.13.mp4

@SwikarBhattarai
Copy link

@pdpino thats great. When are you pushing these??

@pdpino
Copy link
Collaborator

pdpino commented Aug 25, 2022

@SwikarBhattarai before releasing, I think we want a more natural interaction, like the google calendar example

I'm stuck with this right now, help is appreciated.

@SwikarBhattarai
Copy link

@pdpino share the repo link i will try

@pdpino
Copy link
Collaborator

pdpino commented Aug 25, 2022

@SwikarBhattarai this branch in my fork: https://github.com/pdpino/react-native-week-view/tree/feature/wip/174-drag-and-scroll, the drag-scroll code is in src/context/DragEvent.js

@SwikarBhattarai
Copy link

@pdpino did you push recent changes to the branch?? when we drag its crashing in ios simulator

@pdpino
Copy link
Collaborator

pdpino commented Aug 26, 2022

@SwikarBhattarai The branch feature/wip/174-drag-and-scroll has diverged with master. It has more features and is lacking some recent changes. I haven't tested in iOS (can't access an emulator right now)

If you provide details of the crash maybe I can help

@gabcollet
Copy link

@pdpino Any update on this feature?

@pdpino
Copy link
Collaborator

pdpino commented Apr 13, 2023

Sorry, no updates yet. Will get back to this feature and vertical-pinch after current PRs are resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: in progress type: feature enhancements or new features
Projects
None yet
Development

No branches or pull requests

5 participants