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

feat(Sticky): add styleElement prop #3202

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
fix(Sticky): retain passed style (#2908)
  • Loading branch information
Wattenberger committed Oct 9, 2018
commit 73f4d9f8e55546074598e585221c2ae4bfd991c9
3 changes: 3 additions & 0 deletions src/modules/Sticky/Sticky.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export interface StrictStickyProps {

/** Context which sticky should attach onscroll events. */
scrollContext?: object

/** Custom Sticky style. */
style?: object
}

declare const Sticky: React.ComponentClass<StickyProps>
Expand Down
4 changes: 4 additions & 0 deletions src/modules/Sticky/Sticky.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ export default class Sticky extends Component {

/** Context which sticky should attach onscroll events. */
scrollContext: PropTypes.object,

/** Custom Sticky style. */
style: PropTypes.object,
}

static defaultProps = {
Expand Down Expand Up @@ -207,6 +210,7 @@ export default class Sticky extends Component {
bottom: bound ? 0 : bottom,
top: bound ? undefined : top,
width: this.triggerRect.width,
...this.props.style,
}
}

Expand Down