diff --git a/package.json b/package.json index 24c1ea4..dd249b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aptechka", - "version": "0.50.13", + "version": "0.50.14", "repository": { "type": "git", "url": "git+https://github.com/denisavitski/aptechka.git" diff --git a/src/components/packages/custom-scrollbar/index.ts b/src/components/packages/custom-scrollbar/index.ts index 854b94c..c1c3f04 100644 --- a/src/components/packages/custom-scrollbar/index.ts +++ b/src/components/packages/custom-scrollbar/index.ts @@ -5,6 +5,7 @@ import { elementResizer } from '@packages/element-resizer' import { windowResizer } from '@packages/window-resizer' import { findScrollParentElement, isBrowser, setupDrag } from '@packages/utils' +import { ticker } from '@packages/ticker' export class CustomScrollbarElement extends HTMLElement { #scrollElement: HTMLElement = null! @@ -27,6 +28,8 @@ export class CustomScrollbarElement extends HTMLElement { this.#scrollElement.addEventListener('scroll', this.#scrollListener) this.#thumbElement.addEventListener('pointerdown', this.#grabListener) + + ticker.subscribe(this.#tickListener, { maxFPS: 5 }) } } @@ -38,6 +41,8 @@ export class CustomScrollbarElement extends HTMLElement { this.#thumbElement.removeEventListener('pointerdown', this.#grabListener) clearTimeout(this.#activeTimeoutId) + + ticker.unsubscribe(this.#tickListener) } #scrollListener = () => { @@ -98,6 +103,10 @@ export class CustomScrollbarElement extends HTMLElement { const startValue = this.#scrollElement.scrollTop const grabCursor = grabEvent.y } + + #tickListener = () => { + this.#resizeListener() + } } if (isBrowser && !customElements.get('e-custom-scrollbar')) {