fix: container parent filtering
This commit is contained in:
@@ -957,19 +957,10 @@ class ClientSelectorGenerator {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (groupedElementsAtPoint.length > 0) {
|
if (groupedElementsAtPoint.length > 0) {
|
||||||
const hasAnchorTag = groupedElementsAtPoint.some(
|
let filteredElements = this.filterParentChildGroupedElements(
|
||||||
(el) => el.tagName === "A"
|
groupedElementsAtPoint
|
||||||
);
|
);
|
||||||
|
|
||||||
let filteredElements = groupedElementsAtPoint;
|
|
||||||
|
|
||||||
if (hasAnchorTag) {
|
|
||||||
// Apply parent-child filtering when anchor tags are present
|
|
||||||
filteredElements = this.filterParentChildGroupedElements(
|
|
||||||
groupedElementsAtPoint
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sort by DOM depth (deeper elements first for more specificity)
|
// Sort by DOM depth (deeper elements first for more specificity)
|
||||||
filteredElements.sort((a, b) => {
|
filteredElements.sort((a, b) => {
|
||||||
const aDepth = this.getElementDepth(a);
|
const aDepth = this.getElementDepth(a);
|
||||||
|
|||||||
Reference in New Issue
Block a user