Skip to content

Commit

Permalink
fix: #2391 Browse app page scrolling is disabled when not over app li…
Browse files Browse the repository at this point in the history
…st (#2444)
  • Loading branch information
Vu Nguyen authored Aug 24, 2020
1 parent 5ad5e61 commit d11f2b2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ exports[`Client should match a snapshot when LOADING false 1`] = `
setComingSoonAppSectionHeight={[Function]}
>
<div
id="coming-soon-section"
style={
Object {
"minHeight": "100%",
Expand Down Expand Up @@ -519,6 +520,7 @@ exports[`Client should match a snapshot when LOADING false 2`] = `
setComingSoonAppSectionHeight={[Function]}
>
<div
id="coming-soon-section"
style={
Object {
"minHeight": "100%",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

exports[`ComingSoonApps should match a snapshot 1`] = `
<div
id="coming-soon-section"
style={
Object {
"minHeight": "100%",
Expand Down
18 changes: 8 additions & 10 deletions packages/marketplace/src/components/pages/apps/coming-soon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,21 @@ const ComingSoonApps: React.FC<ComingSoonAppsProps> = ({ setComingSoonAppSection
const comingSoonAppSectionRef = React.useRef<HTMLDivElement>(null)

React.useLayoutEffect(() => {
const offsetHeight = comingSoonAppSectionRef.current?.offsetHeight
const clientHeight = comingSoonAppSectionRef.current?.clientHeight
const scrolHeight = comingSoonAppSectionRef.current?.scrollHeight
const offsetHeight = document.getElementById('coming-soon-section')?.offsetHeight
console.log('offsetHeight', offsetHeight)

const boundingClientRect = comingSoonAppSectionRef.current?.getBoundingClientRect()
console.log('boundingClientRect', boundingClientRect)

console.log(
`useLayoutEffect - ComingSoonApps component -> offsetHeight - ${offsetHeight} - clientHeight - ${clientHeight} - scrolHeight - ${scrolHeight}`,
)
if (offsetHeight && setComingSoonAppSectionHeight) {
setComingSoonAppSectionHeight(offsetHeight)
}

console.log(
'---- coming soon boundingClientRect ----',
document.getElementById('coming-soon-section')?.getBoundingClientRect(),
)
})

return (
<div ref={comingSoonAppSectionRef} style={{ minHeight: '100%' }}>
<div id="coming-soon-section" ref={comingSoonAppSectionRef} style={{ minHeight: '100%' }}>
<Grid isMultiLine>
{comingSoonImagesList.map(imgSrc => (
<GridThreeColItem key={imgSrc}>
Expand Down

0 comments on commit d11f2b2

Please sign in to comment.