All files / nexshop-web-contents/src/helpers dom-helper.js

100% Statements 4/4
100% Branches 4/4
100% Functions 1/1
100% Lines 4/4
1 2 3 4 5 6 7 8 91x 5x 5x   5x        
export const isElementInParent = (element, parent) => {
    let childRect = element.getBoundingClientRect();
    let parentRect = parent.getBoundingClientRect();
 
    return childRect.top >= parentRect.top
        && childRect.right <= parentRect.right
        && childRect.bottom <= parentRect.bottom
        && childRect.left >= parentRect.left;
};