Skip to content

Commit

Permalink
Merge fa3aa76 into 250adf5
Browse files Browse the repository at this point in the history
  • Loading branch information
lbebber committed Sep 6, 2019
2 parents 250adf5 + fa3aa76 commit 21d3917
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Fix iOS issue where `sticky` would not work.

## [2.21.6] - 2019-09-04
### Changed
Expand Down
4 changes: 4 additions & 0 deletions react/components/StickyRow.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.positionSticky {
position: -webkit-sticky;
position: sticky;
}
4 changes: 2 additions & 2 deletions react/components/StickyRow.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { FunctionComponent, useContext, CSSProperties } from 'react'
import ReactResizeDetector from 'react-resize-detector'
import { RowContext } from './StickyRows'
import { positionSticky } from './StickyRow.css'

interface Props {
sticky?: boolean
Expand All @@ -11,15 +12,14 @@ const StickyRow: FunctionComponent<Props> = ({ children, sticky, zIndex }) => {
const { offset, onResize } = useContext(RowContext)

const stickyStyle: CSSProperties = {
position: 'sticky',
top: offset,
zIndex,
}

return (
<div
style={sticky ? stickyStyle : undefined}
className={sticky && !zIndex ? 'z-999' : ''}
className={sticky ? `${positionSticky} ${!zIndex ? 'z-999' : ''}` : ''}
>
{children}

Expand Down

0 comments on commit 21d3917

Please sign in to comment.