On my EventCalendar implementation (timeline mode, day or week) I have enabled dragToCreate and clickToCreate. I also have a Popup component that appears when an event is created or clicked on. When I click an event (onEventClicked
handler), I am setting the anchor to args.domEvent.target
which properly positions the popup. The target element in this case is .mbsc-schedule-event-range
.
On drag to create, I want the popup to appear in the same position as if I had clicked on the new event, but I am unable to properly set the anchor to .mbsc-schedule-event-range
like in onEventClicked
. In onEventCreated
the value of args.domEvent.target
is a drag target element that takes up the entirety of the calendar, so the popup is not positioned properly. My current workaround is to set the popup anchor in onEventDragStart
, but it’s far from ideal, as the popup will be positioned underneath wherever I started dragging, rather than centered beneath the new event.
Any ideas of how to properly position my popup in this scenario?