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.

Is your feature request related to a problem? Please describe. Yes.

Describe the solution you’d like Headers to be sticky.

Describe alternatives you’ve considered Finding a way to override styles

Additional context

Seems like the <ScrollBar/>-component which adds a wrapper with overflow, makes it impossible.

Not sure why #709 was closed.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

26reactions
karrettgelleycommented, Jul 18, 2019

The reason I closed it is because there is a very easy solution that I found. First you need to set the header style to sticky:

options={{ headerStyle: { position: ‘sticky’, top: 0 } }}

This alone does not do anything. Next you need to set the body height of the table in order to trigger a vertical scrollbar to appear:

options={{ headerStyle: { position: ‘sticky’, top: 0 }, maxBodyHeight: ‘650px’ }}

The combination of these two function will allow you to have sticky table headers. Hope this helps. Perhaps it should be added to the docs if this is an acceptable solution

13reactions
ingvaldlorentzencommented, Sep 24, 2019

Is there any way to do this without setting the maxBodyHeight ?

I have a table (without pagination) in a view, where I want a sticky header. But when setting maxBodyHeight this creates a new scrollbar within the table. I want the main scrollbar to do the scrolling.

Is this possible at the moment? Any tips?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Create an On Scroll Fixed Header - W3Schools
On Scroll Sticky Header. The header will stick to the top when you reach its scroll position. Scroll back up to remove the...
Read more >
How To Create the Perfect Sticky Header for Your Site With ...
You'll likely already know what a sticky header is, even in an intuitive sense. It's where your site's header section 'sticks' to the...
Read more >
sticky_headers | Flutter Package - Pub.dev
Flutter Sticky Headers - Lets you place headers on scrollable content that will stick to the top of the container whilst the content...
Read more >
Sticky Headers: 5 Ways to Make Them Better - CSS-Tricks
Sticky Headers : 5 Ways to Make Them Better · Keep it small. · Visually contrast it with the rest of the page....
Read more >
One Line - Sticky Header using CSS - DEV Community ‍ ‍
A sticky element toggles between relative and fixed , depending on the scroll position. It is positioned relative until a given offset position ......
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