Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Moves onScroll method on ScrollablePane from root to container",
"packageName": "@fluentui/react",
"email": "bsunderhus@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class ScrollablePaneBase
}

public render(): JSX.Element {
const { className, scrollContainerFocus, scrollContainerAriaLabel, theme, styles } = this.props;
const { className, scrollContainerFocus, scrollContainerAriaLabel, theme, styles, onScroll } = this.props;
const { stickyTopHeight, stickyBottomHeight } = this.state;
const classNames = getClassNames(styles!, {
theme: theme!,
Expand All @@ -200,11 +200,26 @@ export class ScrollablePaneBase
role: 'group',
tabIndex: 0,
'aria-label': scrollContainerAriaLabel,
onScroll,
}
: {};
: {
onScroll,
};

return (
<div {...getNativeProps(this.props, divProperties)} ref={this._root} className={classNames.root}>
<div
{...getNativeProps(
{
...this.props,
},
divProperties,
// on React 17 onScroll is not being invoked on root element,
// as a fix this method will be provided to the container element
['onScroll'],
)}
ref={this._root}
className={classNames.root}
>
<div
ref={this._stickyAboveRef}
className={classNames.stickyAbove}
Expand Down