Fix overlap checks with labels

This commit is contained in:
varjolintu 2025-10-23 21:47:02 +03:00
parent bb1da8c64d
commit bebf47783b

View file

@ -479,7 +479,7 @@ kpxcFields.isTopElement = function(elem, rect) {
const topElement = rootNode.elementFromPoint(x, elementRect.top + (elementRect.height / 2));
return element?.labels &&
element.labels[0] === topElement &&
isElementInside(elementRect, topElement.getBoundingClientRect())
elementsOverlap(elementRect, topElement.getBoundingClientRect())
? element
: topElement;
};