You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: stories/props/onSelectEvent.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@ import LinkTo from '@storybook/addon-links/react'
7
7
8
8
Callback fired when a calendar event is selected (i.e.: an `onClick` handler).
9
9
10
+
The method receives the selected event as a parameter. If using <LinkTokind="props"story="resources">resources</LinkTo>, 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.
11
+
12
+
Clicking on a <LinkTokind="props"story="backgroundEvents">backgroundEvent</LinkTo> 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.
13
+
10
14
**Note:** The <LinkTokind="props"story="selectable">selectable</LinkTo> prop is _not_ required for this prop to function.
11
15
12
16
**Important:** The event passed into the function is the Calendar Event, not the SyntheticEvent expected by most click handlers.
0 commit comments