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

snapDraggedEvents not allowing custom segment styling to stick when dragging on Week View #908

Closed
jcjobin opened this issue Mar 1, 2019 · 2 comments
Labels

Comments

@jcjobin
Copy link

jcjobin commented Mar 1, 2019

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)
@jcjobin jcjobin changed the title snapDraggedEvents not allowing custom segment styling to stick when dragging snapDraggedEvents not allowing custom segment styling to stick when dragging on Week View Mar 1, 2019
@mattlewis92
Copy link
Owner

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

@jcjobin
Copy link
Author

jcjobin commented Mar 18, 2019

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!

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

No branches or pull requests

2 participants