diff --git a/package.json b/package.json index 318dc9e..a5577d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aptechka", - "version": "0.51.6", + "version": "0.51.7", "repository": { "type": "git", "url": "git+https://github.com/denisavitski/aptechka.git" diff --git a/src/components/packages/pixel-perfect/index.ts b/src/components/packages/pixel-perfect/index.ts index 2925aae..458c647 100644 --- a/src/components/packages/pixel-perfect/index.ts +++ b/src/components/packages/pixel-perfect/index.ts @@ -73,7 +73,13 @@ export class PixelPerfectElement extends HTMLElement { } protected connectedCallback() { - this.#scrollParentElement = findScrollParentElement(this) + const scrollSelector = this.getAttribute('scroll-selector') + + if (scrollSelector) { + this.#scrollParentElement = document.querySelector(scrollSelector) + } else { + this.#scrollParentElement = findScrollParentElement(this) + } this.#scrollParentElement?.addEventListener('scroll', this.#scrollListener)