question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Horizontal scrolling

See original GitHub issue

Currently using the following components

<AutoSizer>
  <InfiniteLoader>
    <FlexTable {...props}>
       {children}
    </FlexTable>
  </InfiniteLoader>
</AutoSizer>

This works perfectly but we have a use case where the user can add or remove new columns and the table can become unreadable if it just truncates the columns. I’ve been trying to think of a good way to tackle supporting horizonal scroll so the table has a minimum width and above that it should show a horizontal scroll bar.

Can this be done currently with <VirtualScroll /> HOC?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
ryanseddoncommented, Feb 15, 2016

Ah grid is exactly what I want, I completely overlooked it as I kept thinking it forced me to have a pinterest/instagram style layout.

ScrollSync, genius! Looking forward to v5.

Thanks for answering my poorly researched question.

1reaction
bvaughncommented, Feb 15, 2016

By the way, let’s frame our discussion in terms of version 5 (source, docs, overview) since I hope to be releasing it soon (maybe even this weekend) and it changes things a bit.

v5 adds a new HOC, ScrollSync that can be used to synchronize scrolling between 2 or more virtual components. I mention this in case you might also consider pairing a FlexTable (for your fixed columns) and a Grid (for your dynamic ones). Essentially something like this:

<InfiniteLoader
  isRowLoaded={...}
  loadMoreRows={...}
  rowsCount={...}
>
  {({ onRowsRendered, registerChild }) => (
    <ScrollSync>
      {({ onScroll, scrollLeft, scrollTop }) => (
        <div className='Table'>
          <div className='LeftColumn'>
            <FlexTable
              onScroll={onScroll}
              scrollTop={scrollTop}
              {...props}
            />
          </div>
          <div className='RightColumn'>
            <Grid
              onScroll={onScroll}
              scrollTop={scrollTop}
              {...props}
            />
          </div>
        </div>
      )}
    </ScrollSync>
  )}
</InfiniteLoader>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Horizontal Scrolling in Web Design: How to Do It Well
Horizontal scrolling is a page navigation method in which the user scrolls left and right to reveal content from the sides of the...
Read more >
How To Create a Horizontal Scrolling Menu - W3Schools
How To Create a Horizontal Scrollable Menu. Step 1) Add HTML: Example. <div class="scrollmenu">
Read more >
How To Create Horizontal Scrolling Containers - codeburst
Let's first create our container and our children divs inside of it that will scroll horizontally. The HTML is pretty simple. <div class="scrolling-wrapper">...
Read more >
17 Stunning Horizontal Scrolling Websites - Qode Interactive
Horizontal scrolling is an effect that has the power to make browsing more engrossing and enjoyable. What matters is to plan it well,...
Read more >
Advanced interactions: Horizontal scroll in Webflow - YouTube
As previously seen on Apple's iPad page, horizontal scrolling fully engages visitors by using a unique interaction that changes their ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found