Skip to content

Commit

Permalink
[Tabs] Prevent unwanted auto-move in scrolling tabs (#12276)
Browse files Browse the repository at this point in the history
  • Loading branch information
novascreen authored and oliviertassinari committed Jul 25, 2018
1 parent ec304e6 commit d0eb9c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/material-ui/src/Tabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,13 @@ class Tabs extends React.Component {
theme.direction === 'rtl'
? tabsMeta.scrollLeftNormalized + tabsMeta.clientWidth - tabsMeta.scrollWidth
: tabsMeta.scrollLeft;
left = tabMeta.left - tabsMeta.left + correction;
left = Math.round(tabMeta.left - tabsMeta.left + correction);
}

const indicatorStyle = {
left,
// May be wrong until the font is loaded.
width: tabMeta ? tabMeta.width : 0,
width: tabMeta ? Math.round(tabMeta.width) : 0,
};

if (
Expand Down

0 comments on commit d0eb9c7

Please sign in to comment.