We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import './style.css'; import Sticky from 'react-sticky-el'; export const App = () => { const panels = [{ id: 1 }, { id: 2 }, { id: 3 }]; return ( <div className="wrapper"> <div style={{ display: 'flex', marginTop: 40 }}> {panels.map((p) => ( <div key={p.id} className="panel"> <Sticky scrollElement=".wrapper"> <div className="panel-header">header {p.id}</div> </Sticky> <div className="panel-content">content {p.id}</div> </div> ))} </div> </div> ); };
style.scss:
style.scss
.wrapper { position: relative; height: 300px; width: 600px; overflow: auto; border: 1px solid #ddd; } .panel-header { background-color: red; } .panel-content { background-color: yellow; height: 600px; } .panel { width: 200px; margin: 0 10px; flex-shrink: 0; }
The sticky header does not follow the horizontal scrolling.
stackblitz
The text was updated successfully, but these errors were encountered:
No branches or pull requests
style.scss
:The sticky header does not follow the horizontal scrolling.
stackblitz
The text was updated successfully, but these errors were encountered: