Skip to content

Commit

Permalink
Fix change callback
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinschopf committed Mar 8, 2021
1 parent 943a77a commit 8825516
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ class Hours extends React.Component<Props> {
}
});
if (!conflict) {
if (this.props.onChange) {
this.props.onChange(this.outputOSM());
}
this.calendarRef.current.getApi().addEvent({
start: selectionInfo.start,
end: selectionInfo.end,
});
if (this.props.onChange) {
this.props.onChange(this.outputOSM());
}
}
}}
locale={this.props.locale ? this.props.locale : "en"}
Expand All @@ -244,10 +244,10 @@ class Hours extends React.Component<Props> {
this.props.theme ? this.props.theme : "standard"
}
eventClick={(eventInfo: EventClickArg) => {
eventInfo.event.remove();
if (this.props.onChange) {
this.props.onChange(this.outputOSM());
}
eventInfo.event.remove();
}}
eventOverlap={false}
editable={true}
Expand Down

1 comment on commit 8825516

@vercel
Copy link

@vercel vercel bot commented on 8825516 Mar 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.