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

Unusual Behaviour #85

Closed
AdrianGzzEsc opened this issue Feb 17, 2023 · 8 comments
Closed

Unusual Behaviour #85

AdrianGzzEsc opened this issue Feb 17, 2023 · 8 comments

Comments

@AdrianGzzEsc
Copy link

Heres a video: https://clipchamp.com/watch/WLFnXRSIkbj

Could you explain how it performs the moving action to know if I modify something important that could cause this kind of behaviour. This is not happening on the demo so If you have any idea what could cause it I will really appreciate it

@vkurko
Copy link
Owner

vkurko commented Feb 17, 2023

Unfortunately, it's hard to say why you have this behavior. I can only help if you provide a demo on jsbin/jsfiddle/codepen or similar service.

@AdrianGzzEsc
Copy link
Author

AdrianGzzEsc commented Feb 20, 2023

There you go: https://codepen.io/AdrianGzzEsc/pen/ExePXxR

You can only move red ones and it will ask you to confirm the change. If you go to march it might be easier for you to test. I think it might have something to do with the rows having overflow but I hope you can guide me to make it work with that layout. Thank you very much for all your support so far

@vkurko
Copy link
Owner

vkurko commented Feb 20, 2023

I see 2 problems:

  1. You are adding extra DOM nodes for resumen which breaks the internal structure of the calendar. The drag&drop feature is designed for a specific node structure, so it breaks when the structure is broken.
  2. I'm pretty sure that by adding vertical scrolling to the calendar cells, you also broke drag&drop because it wasn't designed for that.

@AdrianGzzEsc
Copy link
Author

Thank you very much, it was just the added DOM element messing things up. Now I got it working as I wanted!

@vkurko
Copy link
Owner

vkurko commented Feb 21, 2023

Thanks for providing codepen demo. On your data, I noticed a problem with the positioning of events in the calendar:

image

I will try to fix this in the next release.

@AdrianGzzEsc
Copy link
Author

AdrianGzzEsc commented Feb 21, 2023

I updated the codepen so you can notice another problem.

` eventDragStart: function (info) {
revert = JSON.parse(JSON.stringify(info.event))
var day = convert(info.event.start).split('-')
if (parseInt(day[2]) > datePicked)
day[1] = parseInt(day[1]) + 1

                day[2] = datePicked
                day = day.join('-')
                info.event.start = day + " 07:30"
                info.event.end = day + " 17:30"
                ec.updateEvent(info.event)
            },
            eventDrop: function (info) {
                if(!confirm('Deseas modificar esta tarea para el ' + convert(info.event.start) + "?")){
                    ec.updateEvent(revert)
                } else {
                info.event.start = convert(info.event.start) + " 07:30"
                info.event.end = convert(info.event.start) + " 17:30"
                ec.updateEvent(info.event)
                updatePlanProduccion(info.event)
                }
            }`

Since Im updating the event on the eventDragStart I cant use info.revert() on eventDrop function. So what I do its to create a copy of the object and store it in "revert" variable so I can use it later on the eventDrop. If I drag the event to different places and revert it, the second time reverting it always adds a day to the event and then the third one moves it one day.

Heres a video: https://clipchamp.com/watch/HXIb1Z9uLMc

@vkurko
Copy link
Owner

vkurko commented Feb 22, 2023

I updated the codepen so you can notice another problem.

Could you create a separate issue for this please?

@vkurko
Copy link
Owner

vkurko commented Feb 22, 2023

Thanks for providing codepen demo. On your data, I noticed a problem with the positioning of events in the calendar:

image

I will try to fix this in the next release.

This should be fixed in v0.16.1.

@vkurko vkurko closed this as completed Feb 22, 2023
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

2 participants