mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 12:09:26 +00:00
update hasSlot selector to search top-level only (#481)
This commit is contained in:
@@ -43,7 +43,7 @@ export function getTextContent(slot: HTMLSlotElement): string {
|
||||
export function hasSlot(el: HTMLElement, name?: string) {
|
||||
// Look for a named slot
|
||||
if (name) {
|
||||
return el.querySelector(`[slot="${name}"]`) !== null;
|
||||
return el.querySelector(`:scope > [slot="${name}"]`) !== null;
|
||||
}
|
||||
|
||||
// Look for a default slot
|
||||
|
||||
Reference in New Issue
Block a user