Skip to content

Commit c5de08b

Browse files
committed
skip auditTime if set to 0ms
1 parent 59e6fd8 commit c5de08b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/lib/core/overlay/scroll/scroll-dispatcher.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ export class ScrollDispatcher {
5858
* to override the default "throttle" time.
5959
*/
6060
scrolled(auditTimeInMs: number = DEFAULT_AUDIT_TIME): Observable<void> {
61+
// In the case of a 0ms delay, return the observable without auditTime since it does add
62+
// a perceptible delay in processing overhead.
63+
if (auditTimeInMs == 0) {
64+
return this._scrolled.asObservable();
65+
}
66+
6167
return this._scrolled.asObservable().auditTime(auditTimeInMs);
6268
}
6369

src/lib/tooltip/tooltip.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export type TooltipPosition = 'left' | 'right' | 'above' | 'below' | 'before' |
3939
export const TOUCHEND_HIDE_DELAY = 1500;
4040

4141
/** Time in ms to throttle repositioning after scroll events. */
42-
export const SCROLL_THROTTLE_MS = 10;
42+
export const SCROLL_THROTTLE_MS = 0;
4343

4444
/**
4545
* Directive that attaches a material design tooltip to the host element. Animates the showing and

0 commit comments

Comments
 (0)