From 9e142803e5689b73c2c058e407a072679cd109af Mon Sep 17 00:00:00 2001 From: Justin DuJardin Date: Sun, 20 Dec 2015 13:37:56 -0800 Subject: [PATCH] fix(toolbar): use prefix translate for scroll-shrink in safari 8 --- ng2-material/components/toolbar/toolbar.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ng2-material/components/toolbar/toolbar.ts b/ng2-material/components/toolbar/toolbar.ts index aa31d574..0e81a9f0 100644 --- a/ng2-material/components/toolbar/toolbar.ts +++ b/ng2-material/components/toolbar/toolbar.ts @@ -129,8 +129,12 @@ export class MdToolbar implements AfterViewInit, OnChanges, OnDestroy { Math.max(0, this._currentY + scrollTop - this._previousScrollTop) ); - DOM.setStyle(this.el.nativeElement, 'transform', `translate3d(0,${-this._currentY * this.mdShrinkSpeed}px,0)`); - DOM.setStyle(this._content, 'transform', `translate3d(0,${(this._toolbarHeight - this._currentY) * this.mdShrinkSpeed}px,0)`); + let toolbarXform = `translate3d(0,${-this._currentY * this.mdShrinkSpeed}px,0)`; + let contentXform = `translate3d(0,${(this._toolbarHeight - this._currentY) * this.mdShrinkSpeed}px,0)`; + DOM.setStyle(this._content, '-webkit-transform', contentXform); + DOM.setStyle(this._content, 'transform', contentXform); + DOM.setStyle(this.el.nativeElement, '-webkit-transform', toolbarXform); + DOM.setStyle(this.el.nativeElement, 'transform', toolbarXform); this._previousScrollTop = scrollTop;