Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScrollablePane with DetailsList cannot scroll fixed header with list content #5116

luckyyd opened this issue Jun 6, 2018 · 4 comments


Copy link

@luckyyd luckyyd commented Jun 6, 2018

Bug Report

  • Package version(s): 5.106
  • Browser and OS versions: Chrome, Windows 10

Priorities and help requested (not applicable if asking question):

Are you willing to submit a PR to fix? (Yes, No)
Requested priority: (Blocking, High, Normal, Low)
Products/sites affected: (if applicable)

Describe the issue:

When using DetailsList within Scrollable Pane, if the DetailsList has more columns that exceeds the div width, when scroll below, both column header and detailslist appears both horizontal scroll bar, but cannot scroll together:
Scroll to the top:
Scroll down

Expected behavior:

The sticky header should scroll with detailslist together.

If applicable, please provide a codepen repro:


@leddie24 leddie24 self-assigned this Jun 6, 2018
Copy link

@kirankumarmanku kirankumarmanku commented Jun 11, 2018

I am also facing the similar issue with DetailsList with ScrollablePane. Is there any temporary workaround for this?

Copy link

@kirankumarmanku kirankumarmanku commented Jun 11, 2018

Following fix worked for me. I have added onScroll event for the div containing ScrollablePane and attached the following method.

private handleScroll(event) {
  let element = document.querySelector("[class*='stickyAbove-']");
  if(element != null)
      element.scrollLeft =;

I am returning following element.

     <div style={ {
          height: '100%',
          position: 'relative',
          maxHeight: 'inherit'
        } }
          onScroll = {this.handleScroll}
                  items={ sortedItems as any[] }
                  columns={ columns }
                  ariaLabel= "List of data"
                  className = {styles.myclass}
                  layoutMode={ DetailsListLayoutMode.fixedColumns }
                    // tslint:disable-next-line:jsx-no-lambda
                    (detailsHeaderProps: IDetailsHeaderProps, defaultRender: IRenderFunction<IDetailsHeaderProps>) => (
                      stickyPosition={StickyPositionType.Header} >
                        { defaultRender({
                           onRenderColumnHeaderTooltip: (tooltipHostProps: ITooltipHostProps) => <TooltipHost {...tooltipHostProps} />
                        }) }
                    ) }
                  constrainMode = {ConstrainMode.unconstrained}
                  onColumnHeaderClick={ this.onColumnClick }
Copy link

@coreyroth coreyroth commented Oct 3, 2018

I have found that you also need to capture the scroll event on the Sticky as well in case the user scrolls the header. I registered a scroll event with the following:

public componentDidMount(): void { let stickyElemrent = document.querySelector("[class*='stickyAbove-']") if (stickyElemrent != null) { stickyElemrent.addEventListener('scroll', this.hnadleStickyScroll); } }

Then I used a similar event handling method:

private hnadleStickyScroll(event) { let gridElement = document.querySelector("[class*='ms-DetailsList']"); if (gridElement) gridElement.scrollLeft =; event.preventDefault(); }

I wrote more on it in this post.

Copy link

@nealYangVic nealYangVic commented Mar 20, 2019

StickyPositionType.Both will make it work directly....

@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

6 participants
You can’t perform that action at this time.