ui: change <slot> check (#3388)
This commit is contained in:
parent
80ffa15959
commit
ccb332c636
2 changed files with 7 additions and 5 deletions
|
|
@ -122,8 +122,7 @@ export default class TabSessionManager {
|
||||||
this.state.update({
|
this.state.update({
|
||||||
vModeBadge: true,
|
vModeBadge: true,
|
||||||
})
|
})
|
||||||
// easier to spot the warning appearing plus more time to go over all messages
|
}, 0)
|
||||||
}, 1000)
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.lists = new Lists(initialLists);
|
this.lists = new Lists(initialLists);
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,8 @@ export default class DOMManager extends ListWalker<Message> {
|
||||||
all: () => Record<string, string>;
|
all: () => Record<string, string>;
|
||||||
};
|
};
|
||||||
public readonly time: number;
|
public readonly time: number;
|
||||||
private virtualMode: boolean = false;
|
private virtualMode = false;
|
||||||
|
private hasSlots = false
|
||||||
private showVModeBadge?: () => void;
|
private showVModeBadge?: () => void;
|
||||||
|
|
||||||
constructor(params: {
|
constructor(params: {
|
||||||
|
|
@ -297,6 +298,9 @@ export default class DOMManager extends ListWalker<Message> {
|
||||||
this.insertNode(msg);
|
this.insertNode(msg);
|
||||||
this.removeBodyScroll(msg.id, vElem);
|
this.removeBodyScroll(msg.id, vElem);
|
||||||
this.removeAutocomplete(vElem);
|
this.removeAutocomplete(vElem);
|
||||||
|
if (msg.tag === 'SLOT') {
|
||||||
|
this.hasSlots = true;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case MType.MoveNode: {
|
case MType.MoveNode: {
|
||||||
|
|
@ -442,14 +446,13 @@ export default class DOMManager extends ListWalker<Message> {
|
||||||
// shadow DOM for a custom element + SALESFORCE (<slot>)
|
// shadow DOM for a custom element + SALESFORCE (<slot>)
|
||||||
const isCustomElement =
|
const isCustomElement =
|
||||||
vElem.tagName.includes('-') || vElem.tagName === 'SLOT';
|
vElem.tagName.includes('-') || vElem.tagName === 'SLOT';
|
||||||
const hasSlots = vElem.tagName === 'SLOT';
|
|
||||||
|
|
||||||
if (isCustomElement) {
|
if (isCustomElement) {
|
||||||
if (this.virtualMode) {
|
if (this.virtualMode) {
|
||||||
// Store the mapping but don't create the actual shadow root
|
// Store the mapping but don't create the actual shadow root
|
||||||
this.shadowRootParentMap.set(msg.id, msg.frameID);
|
this.shadowRootParentMap.set(msg.id, msg.frameID);
|
||||||
return;
|
return;
|
||||||
} else if (hasSlots) {
|
} else if (this.hasSlots) {
|
||||||
this.showVModeBadge?.();
|
this.showVModeBadge?.();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue