From c5de08bd7746025bb61e442b80e10e6764180323 Mon Sep 17 00:00:00 2001 From: Andrew Seguin Date: Tue, 17 Jan 2017 15:34:03 -0800 Subject: [PATCH] skip auditTime if set to 0ms --- src/lib/core/overlay/scroll/scroll-dispatcher.ts | 6 ++++++ src/lib/tooltip/tooltip.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/core/overlay/scroll/scroll-dispatcher.ts b/src/lib/core/overlay/scroll/scroll-dispatcher.ts index 9f70621a017c..0d4539019e57 100644 --- a/src/lib/core/overlay/scroll/scroll-dispatcher.ts +++ b/src/lib/core/overlay/scroll/scroll-dispatcher.ts @@ -58,6 +58,12 @@ export class ScrollDispatcher { * to override the default "throttle" time. */ scrolled(auditTimeInMs: number = DEFAULT_AUDIT_TIME): Observable { + // In the case of a 0ms delay, return the observable without auditTime since it does add + // a perceptible delay in processing overhead. + if (auditTimeInMs == 0) { + return this._scrolled.asObservable(); + } + return this._scrolled.asObservable().auditTime(auditTimeInMs); } diff --git a/src/lib/tooltip/tooltip.ts b/src/lib/tooltip/tooltip.ts index 1755c0e799cf..68d4fca9a118 100644 --- a/src/lib/tooltip/tooltip.ts +++ b/src/lib/tooltip/tooltip.ts @@ -39,7 +39,7 @@ export type TooltipPosition = 'left' | 'right' | 'above' | 'below' | 'before' | export const TOUCHEND_HIDE_DELAY = 1500; /** Time in ms to throttle repositioning after scroll events. */ -export const SCROLL_THROTTLE_MS = 10; +export const SCROLL_THROTTLE_MS = 0; /** * Directive that attaches a material design tooltip to the host element. Animates the showing and