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

Repo sync #35560

Merged
merged 4 commits into from
Dec 5, 2024
Merged
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
Prev Previous commit
Replace useLayoutEffect with useEffect on scroll button (#53483)
  • Loading branch information
hectorsector authored Dec 5, 2024
commit 8cd4906f4f442349036c3bdfc8da887b8edb104d
4 changes: 2 additions & 2 deletions src/frame/components/ui/ScrollButton/ScrollButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useEffect, useLayoutEffect } from 'react'
import { useState, useEffect } from 'react'
import cx from 'classnames'
import { ChevronUpIcon } from '@primer/octicons-react'
import styles from './ScrollButton.module.scss'
@@ -36,7 +36,7 @@ export const ScrollButton = ({ className, ariaLabel }: ScrollButtonPropsT) => {

// If the window isn't tall enough, the scroll button will hide some of the content
// A11y issue 8822
useLayoutEffect(() => {
useEffect(() => {
function updateDocumentSize() {
setIsTallEnough(document.documentElement.clientHeight > 400)
}
Loading