Skip to content

Commit

Permalink
fix(community-tabs): fix scroll issue
Browse files Browse the repository at this point in the history
  • Loading branch information
elissa-matsushita authored and jraff committed Feb 16, 2021
1 parent c5b22a7 commit e2708f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/Tabs/Tabs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const Tabs = props => {
currentPosition += MOVE_TABS_VALUE
}
if (-currentPosition + lastTabWidth > totalTabsWidth) {
currentPosition = -totalTabsWidth + lastTabWidth - MARGIN_BUFFER
currentPosition = -totalTabsWidth + lastTabWidth + MARGIN_BUFFER
}
if (direction === 'left' && -currentPosition < firstTabWidth) {
currentPosition = 0
Expand Down Expand Up @@ -179,6 +179,9 @@ const Tabs = props => {
if (-tabsTranslatePosition <= firstTabWidth) {
setLeftArrowVisible(false)
setRightArrowVisible(true)
if (-tabsTranslatePosition > 1) {
setLeftArrowVisible(true)
}
} else if (-tabsTranslatePosition < totalTabsWidth) {
setLeftArrowVisible(true)
setRightArrowVisible(true)
Expand Down

0 comments on commit e2708f0

Please sign in to comment.