@@ -268,6 +268,7 @@ let CalendarBasicComp = (function () {
268268const ref = createRef < HTMLDivElement > ( ) ;
269269const editEvent = useRef < EventInput > ( ) ;
270270const initData = useRef < boolean > ( false ) ;
271+ const clickTimeout = useRef < NodeJS . Timeout | null > ( null ) ;
271272const [ form ] = Form . useForm ( ) ;
272273const [ left , setLeft ] = useState < number | undefined > ( undefined ) ;
273274const [ licensed , setLicensed ] = useState < boolean > ( props . licenseKey !== "" ) ;
@@ -370,6 +371,15 @@ let CalendarBasicComp = (function () {
370371initData . current = true ;
371372}
372373} , [ JSON . stringify ( initialEvents ) , comp ?. children ?. comp ?. children ?. initialData ] ) ;
374+
375+ // Cleanup timeout on unmount
376+ useEffect ( ( ) => {
377+ return ( ) => {
378+ if ( clickTimeout . current ) {
379+ clearTimeout ( clickTimeout . current ) ;
380+ }
381+ } ;
382+ } , [ ] ) ;
373383
374384const resources = useMemo ( ( ) => props . resources . value , [ props . resources . value ] ) ;
375385
@@ -850,22 +860,30 @@ let CalendarBasicComp = (function () {
850860handleEventDataChange ,
851861] ) ;
852862
863+ const handleSingleClick = useCallback ( ( ) => {
864+ // Prevent double click from triggering the event
865+ // Use a timeout to debounce rapid clicks
866+ if ( clickTimeout . current ) {
867+ clearTimeout ( clickTimeout . current ) ;
868+ clickTimeout . current = null ;
869+ return ; // This was a double click, don't trigger
870+ }
871+
872+ clickTimeout . current = setTimeout ( ( ) => {
873+ props . onEvent ( 'click' ) ;
874+ clickTimeout . current = null ;
875+ } , 150 ) ; // Small delay to catch double clicks
876+ } , [ props . onEvent ] ) ;
877+
853878const handleDbClick = useCallback ( ( ) => {
854- const event = props . updatedEventsData . find (
855- ( item :EventType ) => item . id === editEvent . current ?. id
856- ) as EventType ;
857879if ( ! props . editable || ! editEvent . current ) {
858880return ;
859881}
860- if ( event ) {
861- showModal ( event , true ) ;
882+ if ( onEventVal && onEventVal . some ( ( e :any ) => e . name === 'doubleClick' ) ) {
883+ // Check if 'doubleClick' is included in the array
884+ props . onEvent ( 'doubleClick' ) ;
862885} else {
863- if ( onEventVal && onEventVal . some ( ( e :any ) => e . name === 'doubleClick' ) ) {
864- // Check if 'doubleClick' is included in the array
865- props . onEvent ( 'doubleClick' ) ;
866- } else {
867- showModal ( editEvent . current as EventType , false ) ;
868- }
886+ showModal ( editEvent . current as EventType , false ) ;
869887}
870888} , [
871889editEvent ,
@@ -974,6 +992,9 @@ let CalendarBasicComp = (function () {
974992allDaySlot = { props . showAllDay }
975993eventContent = { renderEventContent }
976994select = { ( info ) => handleCreate ( info ) }
995+ dateClick = { ( ) => {
996+ handleSingleClick ( ) ;
997+ } }
977998eventClick = { ( info ) => {
978999const event = events . find (
9791000( item :EventInput ) => item . id === info . event . id
@@ -982,6 +1003,7 @@ let CalendarBasicComp = (function () {
9821003setTimeout ( ( ) => {
9831004editEvent . current = undefined ;
9841005} , 500 ) ;
1006+ handleSingleClick ( ) ;
9851007} }
9861008moreLinkClick = { ( info ) => {
9871009let left = 0 ;