Skip to content

Commit f7c8026

Browse files
crisbetojelbourn
authored andcommittedDec 3, 2018
fix(tabs): blurry text in scrolled header on some browsers (#14303)
Rounds the `transform` value when scrolling a paginated tab header, in order to avoid blurriness in some browsers.
1 parent b967130 commit f7c8026

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/lib/tabs/tab-header.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,9 @@ export class MatTabHeader extends _MatTabHeaderMixinBase
338338
// seems to cause flickering and overflow in Internet Explorer. For example, the ink bar
339339
// and ripples will exceed the boundaries of the visible tab bar.
340340
// See: https://github.com/angular/material2/issues/10276
341-
this._tabList.nativeElement.style.transform = `translateX(${translateX}px)`;
341+
// We round the `transform` here, because transforms with sub-pixel precision cause some
342+
// browsers to blur the content of the element.
343+
this._tabList.nativeElement.style.transform = `translateX(${Math.round(translateX)}px)`;
342344

343345
// Setting the `transform` on IE will change the scroll offset of the parent, causing the
344346
// position to be thrown off in some cases. We have to reset it ourselves to ensure that

0 commit comments

Comments
 (0)
Please sign in to comment.