Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 52305fe

Browse files
latest changes
2 parents 1db61e7 + 6a1b7cc commit 52305fe

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

‎client/packages/lowcoder-comps/src/comps/calendarComp/calendarComp.tsx

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ import {
4646
CalendarDeleteIcon,
4747
Tooltip,
4848
useMergeCompStyles,
49-
} from "lowcoder-sdk";
49+
EditorContext,
50+
CompNameContext,
51+
} from 'lowcoder-sdk';
5052

5153
import {
5254
DefaultWithFreeViewOptions,
@@ -121,6 +123,12 @@ let CalendarBasicComp = (function () {
121123
currentFreeView?: string;
122124
currentPremiumView?: string;
123125
}, dispatch: any) => {
126+
127+
const comp = useContext(EditorContext).getUICompByName(
128+
useContext(CompNameContext)
129+
);
130+
const onEventVal = comp?.toJsonValue().comp.onEvent;
131+
124132

125133
const theme = useContext(ThemeContext);
126134
const ref = createRef<HTMLDivElement>();
@@ -288,10 +296,6 @@ let CalendarBasicComp = (function () {
288296
}
289297

290298
const handleDbClick = () => {
291-
console.log("props.events", props.events)
292-
console.log("props.onEvent", props.onEvent)
293-
console.log("props", props)
294-
295299
const event = props.events.value.find(
296300
(item: EventType) => item.id === editEvent.current?.id
297301
) as EventType;
@@ -308,7 +312,17 @@ let CalendarBasicComp = (function () {
308312
};
309313
showModal(eventInfo, true);
310314
} else {
311-
showModal(editEvent.current, false);
315+
if (onEventVal) {
316+
onEventVal.forEach((event:any) => {
317+
if (event.name === 'doubleClick') {
318+
props.onEvent('doubleClick')
319+
} else {
320+
showModal(editEvent.current as EventType, false);
321+
}
322+
});
323+
} else {
324+
showModal(editEvent.current, false);
325+
}
312326
}
313327
};
314328

@@ -438,7 +452,6 @@ let CalendarBasicComp = (function () {
438452
props.onDropEvent("dropEvent");
439453
}
440454
};
441-
442455
return (
443456
<Wrapper
444457
ref={ref}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /