mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-07 13:30:33 +03:00
fix: resolve menu synchronization issue (use proper throttle)
This commit is contained in:
parent
29207cf0d2
commit
84d1c7b2f2
|
@ -1,7 +1,7 @@
|
|||
import { bind, debounce } from 'decko';
|
||||
import { bind } from 'decko';
|
||||
import { EventEmitter } from 'eventemitter3';
|
||||
|
||||
import { isBrowser, querySelector } from '../utils';
|
||||
import { isBrowser, querySelector, Throttle } from '../utils';
|
||||
import { RedocNormalizedOptions } from './RedocNormalizedOptions';
|
||||
|
||||
const EVENT = 'scroll';
|
||||
|
@ -75,7 +75,7 @@ export class ScrollService {
|
|||
}
|
||||
|
||||
@bind
|
||||
@debounce(100)
|
||||
@Throttle(100)
|
||||
handleScroll() {
|
||||
const scrollY = this.scrollY();
|
||||
const isScrolledDown = scrollY - this._prevOffsetY > 0;
|
||||
|
|
|
@ -6,3 +6,4 @@ export * from './helpers';
|
|||
export * from './highlight';
|
||||
export * from './loadAndBundleSpec';
|
||||
export * from './dom';
|
||||
export * from './decorators';
|
||||
|
|
Loading…
Reference in New Issue
Block a user