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

Issue when dropping data on line between timeslot #1062

Closed
ALapaque opened this issue Aug 16, 2019 · 8 comments · Fixed by #1070
Closed

Issue when dropping data on line between timeslot #1062

ALapaque opened this issue Aug 16, 2019 · 8 comments · Fixed by #1070
Milestone

Comments

@ALapaque
Copy link

ALapaque commented Aug 16, 2019

Describe the bug

Hi @mattlewis92 first I wanted to thank you for such a great calendar !

I've experienced an issue when I'm dropping data into to the calendar, somehow people are able to trigger the drop on the line between two time slots and it creates two events.
How could we manage and avoid that ?

Here below you can see the reproduction of the issue

Minimal reproduction of the problem with instructions

Get dragable data and drop it on the line between two time slots

Screenshots

timeSlots

Versions

  • @angular/core:7.2.2
  • angular-calendar:0.27.7
  • Browser name and version: Chrome Version 76.0.3809.100 (Build officiel) (64 bits)
@matts-bot
Copy link

matts-bot bot commented Aug 16, 2019

Thanks so much for opening an issue! If you'd like me to give priority to answering your issue or would just like to support this project, then please consider supporting me on Patreon

@mattlewis92
Copy link
Owner

mattlewis92 commented Aug 18, 2019

Oh how weird, I can't think of a nice solution to this right now, but in the meantime you could use a debounce on the function call to prevent it yourself: https://stackblitz.com/edit/angular-yg9dnf?file=demo/component.ts

Edit: possible solutions to try:

  • record the last element that was triggered by dragEnter and check it when dropping
  • add a new option to angular-draggable-droppable like borderWidth or maybe more flexible, validateDrop

@ALapaque
Copy link
Author

Hi @mattlewis92,

Thank you for your answer I'll try that ASAP and of course I'll let you know if it fixed my issue.

mattlewis92 added a commit that referenced this issue Aug 25, 2019
BREAKING CHANGE: if using a custom `headerTemplate` on the week view, then you must now add `let-dragEnter="dragEnter"` to the templates variables and `(dragEnter)="dragEnter.emit({ date: day.date })"` onto the `mwlDroppable` element.

Closes #1062
@mattlewis92 mattlewis92 added this to the 0.28 milestone Aug 25, 2019
@mattlewis92 mattlewis92 mentioned this issue Aug 25, 2019
@mattlewis92
Copy link
Owner

I managed to find a fix for this, and it's in the next beta, you can try it with:

npm i angular-calendar@next

Hope that helps! 😄

@ALapaque
Copy link
Author

Hi @mattlewis92

Well thank you very much for such a quick fix for this issue.
This works perfectly

Thanks :)

@ALapaque
Copy link
Author

Any date for a next release ? :D

@mattlewis92
Copy link
Owner

The last thing to do before I release 0.28 as stable is #888, but there are no more changes planned for the component itself, so please consider the beta version as being stable 😄

@ALapaque
Copy link
Author

Great ! thanks again :)

mattlewis92 added a commit that referenced this issue Sep 4, 2019
BREAKING CHANGE: if using a custom `headerTemplate` on the week view, then you must now add `let-dragEnter="dragEnter"` to the templates variables and `(dragEnter)="dragEnter.emit({ date: day.date })"` onto the `mwlDroppable` element.

Closes #1062
mattlewis92 added a commit that referenced this issue Sep 4, 2019
BREAKING CHANGE: if using a custom `headerTemplate` on the week view, then you must now add `let-dragEnter="dragEnter"` to the templates variables and `(dragEnter)="dragEnter.emit({ date: day.date })"` onto the `mwlDroppable` element.

Closes #1062
mattlewis92 added a commit that referenced this issue Sep 4, 2019
BREAKING CHANGE: if using a custom `headerTemplate` on the week view, then you must now add `let-dragEnter="dragEnter"` to the templates variables and `(dragEnter)="dragEnter.emit({ date: day.date })"` onto the `mwlDroppable` element.

Closes #1062
mattlewis92 added a commit that referenced this issue Oct 19, 2019
BREAKING CHANGE: if using a custom `headerTemplate` on the week view, then you must now add `let-dragEnter="dragEnter"` to the templates variables and `(dragEnter)="dragEnter.emit({ date: day.date })"` onto the `mwlDroppable` element.

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

Successfully merging a pull request may close this issue.

2 participants