@@ -9,6 +9,8 @@ import * as dates from './utils/dates'
99import BackgroundCells from './BackgroundCells'
1010import EventRow from './EventRow'
1111import EventEndingRow from './EventEndingRow'
12+ import NoopWrapper from './NoopWrapper'
13+ import ScrollableWeekWrapper from './ScrollableWeekWrapper'
1214import * as DateSlotMetrics from './utils/DateSlotMetrics'
1315
1416class DateContentRow extends React . Component {
@@ -71,10 +73,15 @@ class DateContentRow extends React.Component {
7173 }
7274
7375 renderDummy = ( ) => {
74- let { className, range, renderHeader } = this . props
76+ let { className, range, renderHeader, showAllEvents } = this . props
7577 return (
7678 < div className = { className } >
77- < div className = "rbc-row-content" >
79+ < div
80+ className = { clsx (
81+ 'rbc-row-content' ,
82+ showAllEvents && 'rbc-row-content-scrollable'
83+ ) }
84+ >
7885 { renderHeader && (
7986 < div className = "rbc-row" ref = { this . createHeadingRef } >
8087 { range . map ( this . renderHeadingCell ) }
@@ -118,13 +125,17 @@ class DateContentRow extends React.Component {
118125 longPressThreshold,
119126 isAllDay,
120127 resizable,
128+ showAllEvents,
121129 } = this . props
122130
123131 if ( renderForMeasure ) return this . renderDummy ( )
124132
125133 let metrics = this . slotMetrics ( this . props )
126134 let { levels, extra } = metrics
127135
136+ let ScrollableWeekComponent = showAllEvents
137+ ? ScrollableWeekWrapper
138+ : NoopWrapper
128139 let WeekWrapper = components . weekWrapper
129140
130141 const eventRowProps = {
@@ -159,24 +170,31 @@ class DateContentRow extends React.Component {
159170 resourceId = { resourceId }
160171 />
161172
162- < div className = "rbc-row-content" >
173+ < div
174+ className = { clsx (
175+ 'rbc-row-content' ,
176+ showAllEvents && 'rbc-row-content-scrollable'
177+ ) }
178+ >
163179 { renderHeader && (
164180 < div className = "rbc-row " ref = { this . createHeadingRef } >
165181 { range . map ( this . renderHeadingCell ) }
166182 </ div >
167183 ) }
168- < WeekWrapper isAllDay = { isAllDay } { ...eventRowProps } >
169- { levels . map ( ( segs , idx ) => (
170- < EventRow key = { idx } segments = { segs } { ...eventRowProps } />
171- ) ) }
172- { ! ! extra . length && (
173- < EventEndingRow
174- segments = { extra }
175- onShowMore = { this . handleShowMore }
176- { ...eventRowProps }
177- />
178- ) }
179- </ WeekWrapper >
184+ < ScrollableWeekComponent >
185+ < WeekWrapper isAllDay = { isAllDay } { ...eventRowProps } >
186+ { levels . map ( ( segs , idx ) => (
187+ < EventRow key = { idx } segments = { segs } { ...eventRowProps } />
188+ ) ) }
189+ { ! ! extra . length && (
190+ < EventEndingRow
191+ segments = { extra }
192+ onShowMore = { this . handleShowMore }
193+ { ...eventRowProps }
194+ />
195+ ) }
196+ </ WeekWrapper >
197+ </ ScrollableWeekComponent >
180198 </ div >
181199 </ div >
182200 )
@@ -200,6 +218,7 @@ DateContentRow.propTypes = {
200218 longPressThreshold : PropTypes . number ,
201219
202220 onShowMore : PropTypes . func ,
221+ showAllEvents : PropTypes . bool ,
203222 onSelectSlot : PropTypes . func ,
204223 onSelect : PropTypes . func ,
205224 onSelectEnd : PropTypes . func ,
0 commit comments