Angular-calendar: snapDraggedEvents not allowing custom segment styling to stick when dragging on Week View

Created on 1 Mar 2019  路  2Comments  路  Source: mattlewis92/angular-calendar

Describe the bug

I noticed that using beforeViewRender on mwl-calendar-week-view, I can apply styling to "disable" specific segments. But, then I drag an event on the week view, the styling goes away.
When I do the same thing on mwl-calendar-day-view, the styling does not go away.
I then started looking at the differences between day and week view. I noticed this line in week view:
[dragOverClass]="!dragActive || !snapDraggedEvents ? 'cal-drag-over' : null"

And in Day view it looks like:
dragOverClass="cal-drag-over"

So I thought, what if I set snapDraggedEvents to false, would my styling stick? And voila, it does! (As shown in the gif below)

I just have a couple of questions, what is the purpose of only applying the cal-drag-over class when not snapDraggedEvents or not drag active? Why is it applied in week view but not day view?

For now I am setting snapDraggedEvents to false in my project to avoid this, but would like to eventually have the snapping effect as well. Maybe instead of "null" we can apply segment.cssClass?

Hope to hear from you soon.


Minimal reproduction of the problem with instructions

Here is my stackblitz link: https://stackblitz.com/edit/angular-rxyzbe?file=demo%2Ftemplate.html

Follow same procedure as this gif:

snadrageventbug_stackblitz

Screenshots

Versions

Taken from stackblitz

  • @angular/core: 6.1.10
  • angular-calendar: 0.26.6
  • Browser name and version: Google Chrome Version 72.0.3626.119 (Official Build) (64-bit)
bug

Most helpful comment

Thanks for digging into this and providing the clear repro, I've just released 0.26.11 with a fix 馃槃

Appreciate the work, just updated and it works slick!

All 2 comments

Thanks for digging into this and providing the clear repro, I've just released 0.26.11 with a fix 馃槃

Thanks for digging into this and providing the clear repro, I've just released 0.26.11 with a fix 馃槃

Appreciate the work, just updated and it works slick!

Was this page helpful?
0 / 5 - 0 ratings