Skip to content

Commit b23adc8

Browse files
calendar comp backward compatibility
1 parent 26eb288 commit b23adc8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

client/packages/lowcoder-comps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lowcoder-comps",
3-
"version": "2.4.11",
3+
"version": "2.4.13",
44
"type": "module",
55
"license": "MIT",
66
"dependencies": {

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ let childrenMap: any = {
7979
resourcesEvents: jsonValueExposingStateControl("resourcesEvents", resourcesEventsDefaultData),
8080
resources: jsonValueExposingStateControl("resources", resourcesDefaultData),
8181
resourceName: withDefault(StringControl, trans("calendar.resourcesDefault")),
82-
onEvent: CalendarEventHandlerControl,
82+
onEvent: CalendarEventHandlerControl ? CalendarEventHandlerControl : ChangeEventHandlerControl,
8383
// onDropEvent: safeDragEventHandlerControl,
8484
editable: withDefault(BoolControl, true),
8585
showEventTime: withDefault(BoolControl, true),
@@ -124,10 +124,10 @@ let CalendarBasicComp = (function () {
124124
currentPremiumView?: string;
125125
}, dispatch: any) => {
126126

127-
const comp = useContext(EditorContext).getUICompByName(
128-
useContext(CompNameContext)
127+
const comp = useContext(EditorContext).getUICompByName(
128+
useContext(CompNameContext)
129129
);
130-
const onEventVal = comp?.toJsonValue().comp.onEvent;
130+
const onEventVal = comp?.toJsonValue()?.comp?.onEvent;
131131

132132

133133
const theme = useContext(ThemeContext);

0 commit comments

Comments
 (0)