Skip to content

Commit

Permalink
fix(ld-tabs): safari layout bug due to different offset calculation
Browse files Browse the repository at this point in the history
Fixes #424
  • Loading branch information
borisdiakur committed Sep 19, 2022
1 parent 76b7bb9 commit 467ab8b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/liquid/components/ld-tabs/ld-tablist/ld-tablist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,11 @@ export class LdTablist {
return
}

const bcr = this.selectedTab.getBoundingClientRect()
const offsetLeft = this.selectedTab.offsetLeft
const selectedTabBcr = this.selectedTab.getBoundingClientRect()
const parentBcr = this.selectedTab.parentElement.getBoundingClientRect()
const offsetLeft = selectedTabBcr.left - parentBcr.left
indicatorStyle.transform = `translateX(${offsetLeft - 8}px)`
indicatorStyle.width = `${bcr.width}px`
indicatorStyle.width = `${selectedTabBcr.width}px`
indicatorStyle.opacity = '1'
}

Expand Down

1 comment on commit 467ab8b

@vercel
Copy link

@vercel vercel bot commented on 467ab8b Sep 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

liquid – ./

liquid-git-main-uxsd.vercel.app
liquid-oxygen.vercel.app
liquid-uxsd.vercel.app

Please sign in to comment.