Skip to content

fixed #97: [Edge] Arrow is not focused below the Work menu #81

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

Merged
Merged
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/components/TopNav/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,15 @@ const TopNav = ({
const rect = el.getBoundingClientRect()
return {
...menu,
initialX: rect.x
initialX: rect.left
}
}))
}, [cache.refs, cache.slide])

const getMenuCenter = useCallback(menuId => {
const el = cache.refs[menuId]
const rect = el.getBoundingClientRect()
return rect.x + rect.width / 2
return rect.left + rect.width / 2
}, [cache.refs])

const setChosenArrowPos = useCallback(menuId => {
Expand Down Expand Up @@ -263,7 +263,7 @@ const TopNav = ({
cache.slide[menu.id] = false
const el = cache.refs[menu.id]
const rect = el.getBoundingClientRect()
const relativeX = menu.initialX - rect.x
const relativeX = menu.initialX - rect.left
el.style.transform = `translateX(${relativeX}px)`
setTimeout(() => {
el.style.transition = 'transform 250ms ease-out'
Expand Down