@@ -18,7 +18,11 @@ export interface TimelineListProps {
1818 /**
1919 * General timeline props to pass to each timeline item
2020 */
21- timelineProps ?: Omit < TimelineProps , 'events' | 'showNowIndicator' | 'scrollToNow' | 'initialTime' > ;
21+ timelineProps ?: Omit < TimelineProps , 'events' | 'scrollToFirst' | 'showNowIndicator' | 'scrollToNow' | 'initialTime' > ;
22+ /**
23+ * Should scroll to first event of the day
24+ */
25+ scrollToFirst ?: boolean ;
2226 /**
2327 * Should show now indicator (shown only on "today" timeline)
2428 */
@@ -34,7 +38,7 @@ export interface TimelineListProps {
3438}
3539
3640const TimelineList = ( props : TimelineListProps ) => {
37- const { timelineProps, events, showNowIndicator, scrollToNow, initialTime} = props ;
41+ const { timelineProps, events, showNowIndicator, scrollToFirst , scrollToNow, initialTime} = props ;
3842 const { date, updateSource, setDate} = useContext ( Context ) ;
3943 const listRef = useRef < any > ( ) ;
4044 const prevDate = useRef ( date ) ;
@@ -103,9 +107,9 @@ const TimelineList = (props: TimelineListProps) => {
103107 key = { item }
104108 date = { item }
105109 events = { timelineEvent }
106- scrollToFirst = { false }
107110 scrollToNow = { _isToday && isInitialPage && scrollToNow }
108111 initialTime = { ! _isToday && isInitialPage ? initialTime : undefined }
112+ scrollToFirst = { ! _isToday && isInitialPage && scrollToFirst }
109113 scrollOffset = { isCurrent ? undefined : timelineOffset }
110114 onChangeOffset = { onTimelineOffsetChange }
111115 showNowIndicator = { _isToday && showNowIndicator }
0 commit comments