Skip to content

Commit 72d738e

Browse files
committed
Revert "fix(core): add isServer to scrollspy controller"
This reverts commit 701f33f.
1 parent 701f33f commit 72d738e

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

core/pfe-core/controllers/scroll-spy-controller.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import type { ReactiveController, ReactiveControllerHost } from 'lit';
22

3-
import { isServer } from 'lit';
4-
53
export interface ScrollSpyControllerOptions extends IntersectionObserverInit {
64
/**
75
* Tag names of legal link children.
@@ -35,15 +33,13 @@ export class ScrollSpyController implements ReactiveController {
3533
static #instances = new Set<ScrollSpyController>;
3634

3735
static {
38-
if (!isServer) {
39-
addEventListener('scroll', () => {
40-
if (Math.round(window.innerHeight + window.scrollY) >= document.body.scrollHeight) {
41-
this.#instances.forEach(ssc => {
42-
ssc.#setActive(ssc.#linkChildren.at(-1));
43-
});
44-
}
45-
}, { passive: true });
46-
}
36+
addEventListener('scroll', () => {
37+
if (Math.round(window.innerHeight + window.scrollY) >= document.body.scrollHeight) {
38+
this.#instances.forEach(ssc => {
39+
ssc.#setActive(ssc.#linkChildren.at(-1));
40+
});
41+
}
42+
}, { passive: true });
4743
}
4844

4945
#tagNames: string[];

0 commit comments

Comments
 (0)