From 0eda44e63169ba0b213c7c4e8336a71b5fc55145 Mon Sep 17 00:00:00 2001 From: Steve 'Cutter' Blades Date: Fri, 26 Jan 2024 12:04:57 -0500 Subject: [PATCH] docs: update onSelectEvent prop story (#2492) --- stories/props/onSelectEvent.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stories/props/onSelectEvent.mdx b/stories/props/onSelectEvent.mdx index daa183ef1..9ea6b7388 100644 --- a/stories/props/onSelectEvent.mdx +++ b/stories/props/onSelectEvent.mdx @@ -7,6 +7,10 @@ import LinkTo from '@storybook/addon-links/react' Callback fired when a calendar event is selected (i.e.: an `onClick` handler). +The method receives the selected event as a parameter. If using resources, and are in a TimeGrid view ('day' or 'week'), the `event` will have an additional `sourceResource` property containing the resource object that the event is associated with. + +Clicking on a backgroundEvent will also fire the `onSelectEvent` callback. It will also receive the `backgroundEvent` as the `event` object, but contain a `isBackgroundEvent` property set to `true`. This will allow you to distinguish between a background event and a regular event within your `onSelectEvent` handler. + **Note:** The selectable prop is _not_ required for this prop to function. **Important:** The event passed into the function is the Calendar Event, not the SyntheticEvent expected by most click handlers.