@@ -16,7 +16,7 @@ import { dndSelector, optionsSelector, viewSelector } from '@src/selectors';
16
16
import { DraggingState } from '@src/slices/dnd' ;
17
17
import { isSameDate } from '@src/time/datetime' ;
18
18
import { passConditionalProp } from '@src/utils/preact' ;
19
- import { isNil } from '@src/utils/type' ;
19
+ import { isPresent } from '@src/utils/type' ;
20
20
21
21
import type { CalendarColor } from '@t/options' ;
22
22
@@ -144,8 +144,9 @@ export function HorizontalEvent({
144
144
const eventContainerRef = useRef < HTMLDivElement > ( null ) ;
145
145
146
146
const { isReadOnly, id, calendarId } = uiModel . model ;
147
- const isDraggableEvent =
148
- ! isReadOnlyCalendar && ! isReadOnly && isNil ( resizingWidth ) && isNil ( movingLeft ) ;
147
+
148
+ const isDraggingGuideEvent = isPresent ( resizingWidth ) || isPresent ( movingLeft ) ;
149
+ const isDraggableEvent = ! isReadOnlyCalendar && ! isReadOnly && ! isDraggingGuideEvent ;
149
150
150
151
const startDragEvent = ( className : string ) => {
151
152
setDraggingEventUIModel ( uiModel ) ;
@@ -160,8 +161,7 @@ export function HorizontalEvent({
160
161
if (
161
162
draggingState === DraggingState . DRAGGING &&
162
163
draggingEventUIModel ?. cid ( ) === uiModel . cid ( ) &&
163
- isNil ( resizingWidth ) &&
164
- isNil ( movingLeft )
164
+ ! isDraggingGuideEvent
165
165
) {
166
166
setIsDraggingTarget ( true ) ;
167
167
} else {
@@ -170,7 +170,7 @@ export function HorizontalEvent({
170
170
} ) ;
171
171
172
172
useEffect ( ( ) => {
173
- if ( isNil ( resizingWidth ) && isNil ( movingLeft ) ) {
173
+ if ( ! isDraggingGuideEvent ) {
174
174
eventBus . fire ( 'afterRenderEvent' , uiModel . model . toEventObject ( ) ) ;
175
175
}
176
176
// This effect is only for the first render.
0 commit comments