question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

weekView dragEnter & dragLeave event on segment

See original GitHub issue

Is your feature request related to a problem? Please describe

Hey there @mattlewis92 😃 Thanks for your great work !

I’m looking to display the segment hour when i’m hovering a segment in the different views. As shown below hover_tooltip

but the problem is not the hover but the dragOver, I’d like to display the same thing but when I’m hovering an hour segment while dragging something. → example below

hover_tooltip_drag

Describe the solution you’d like

Could it be possible to drigger the fact that we dragEnter and dragLeave an hourSegment ?

I’ve been able to do it in my day view as I use the day-view-scheduler and we have access to the component mwl-calendar-week-view-hour-segment in the html here is the code I’ve added

<mwl-calendar-week-view-hour-segment
                    *ngFor="let segment of hour.segments; trackBy: trackByHourSegment"
                    [style.height.px]="hourSegmentHeight"
                    [segment]="segment"
                    [segmentHeight]="hourSegmentHeight"
                    [locale]="locale"
                    [customTemplate]="hourSegmentTemplate"
                    (mwlClick)="hourSegmentClicked.emit({ date: segment.date,
                                                              sourceEvent: $event})"
                    [clickListenerDisabled]="hourSegmentClicked.observers.length === 0"
                    mwlDroppable
                    [dragOverClass]="!dragActive || !snapDraggedEvents ? 'cal-drag-over' : null"
                    dragActiveClass="cal-drag-active"
                    [matTooltip]="segment.displayDate | calendarDate: 'weekViewHour':locale"
                    [matTooltipClass]="'segment-tooltip'"
                    [matTooltipShowDelay]="100"
                    #segmentTooltip="matTooltip"
                    (dragLeave)="segmentTooltip.hide()"
                    (dragEnter)="segmentTooltip.show()"
                    (drop)="eventDropped($event, segment.date, false)">
</mwl-calendar-week-view-hour-segment>

and here is the result

hover_tooltip_drag_day_view

Describe your use case for implementing this feature

When I’m dragging something on my calendar it’s sometimes hard to see which timeslot i’m dropping the event

Additional context

Thanks for your help @mattlewis92 😃

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ALapaquecommented, Oct 27, 2020

Ok I see now 😃 @mattlewis92 thanks again for your help 😃

1reaction
ALapaquecommented, Oct 26, 2020

@mattlewis92 Yay !

Here is the mix I did 😃

<!-- CUSTOM AGENDA SEGMENT -->
<ng-template #customHourSegmentTemplate
             let-segment="segment"
             let-locale="locale"
             let-segmentHeight="segmentHeight"
             let-isTimeLabel="isTimeLabel">
  <div class="cal-hour-segment"
       [style.height.px]="segmentHeight"
       [class.cal-hour-start]="segment.isStart"
       [class.cal-after-hour-start]="!segment.isStart"
       [ngClass]="segment.cssClass"
       #segmentTooltip="matTooltip"
       [matTooltip]="segment.displayDate | calendarDate: 'weekViewHour':locale"
       [matTooltipClass]="'tooltip tooltip--segment'"
       [matTooltipShowDelay]="100"
       mwlDroppable
       (dragLeave)="segmentTooltip.hide()"
       (dragEnter)="segmentTooltip.show()">
    <div class="cal-time" *ngIf="isTimeLabel">
      {{ segment.displayDate | calendarDate: "weekViewHour":locale }}
    </div>
    <span class="now-line"
          *ngIf="!isTimeLabel && segment && isCurrentHourSegment(segment)"
          [style.top]="getCurrentHourSegmentOffset(segment, segmentHeight)">
    </span>
  </div>
</ng-template>

in order to be able to display the tooltip from angular-material and it works well 👍 Can you explain to a me a bit the direction mwlDroppable what does it do there ?

Does it allow to trigger the events on the dragLeave and dragEnter on the element marked ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

mwl-calendar-week-view - angular-calendar documentation
newStart, true) " (dragEnter)="dateDragEnter($event.date)" > </mwl-calendar-week-view-header> <div class="cal-all-day-events" #allDayEventsContainer ...
Read more >
Angular-calendar drag events across days - Stack Overflow
I modified a week-view to display a day-view-scheduler component instead of a singular column as it does normally. enter image description here.
Read more >
HTMLElement: dragleave event - Web APIs | MDN
The dragleave event is fired when a dragged element or text selection leaves a valid drop target.
Read more >
Angular (forked) - StackBlitz
$event.newStart, true). " (dragEnter)="dateDragEnter($event. date)". > </mwl-calendar-week-view-header>. <div. class="cal-all-day-events".
Read more >
angular-calendar - UNPKG
cssClass\"\n mwlDraggable\n [class.cal-draggable]=\"event.draggable\"\n ... >\n <mwl-calendar-week-view-hour-segment\n *ngFor=\"let segment of hour.segments ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found