Skip to content

Commit

Permalink
fix(shared): scope querySelector to direct children, like slots are
Browse files Browse the repository at this point in the history
  • Loading branch information
Westbrook committed Sep 7, 2023
1 parent 61f526d commit 515eaee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/shared/src/observe-slot-presence.ts
Expand Up @@ -82,13 +82,13 @@ export function ObserveSlotPresence<T extends Constructor<ReactiveElement>>(
public managePresenceObservedSlot = (): void => {
let changes = false;
lightDomSelectors.forEach((selector) => {
const nextValue = !!this.querySelector(selector);
const nextValue = !!this.querySelector(`:scope > ${selector}`);
const previousValue =
this[slotContentIsPresent].get(selector) || false;
changes = changes || previousValue !== nextValue;
this[slotContentIsPresent].set(
selector,
!!this.querySelector(selector)
!!this.querySelector(`:scope > ${selector}`)
);
});
if (changes) {
Expand Down

0 comments on commit 515eaee

Please sign in to comment.