@progress/kendo-popup-common
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -83,8 +83,2 @@ module.exports = | ||
exports.default = function (element) { | ||
var elementLeft = element.style.left; | ||
var elementTop = element.style.top; | ||
element.style.left = ''; | ||
element.style.top = ''; | ||
var rect = element.getBoundingClientRect(); | ||
@@ -103,5 +97,2 @@ var _rect = rect, | ||
element.style.left = elementLeft; | ||
element.style.top = elementTop; | ||
return { | ||
@@ -108,0 +99,0 @@ top: top, |
@@ -19,3 +19,3 @@ import { $, withRoot } from 'e2e-utils'; | ||
it('should return bounding rect applying window scroll position', () => { | ||
it('should return bounding rect without window scroll position', () => { | ||
root.append("<style>body { height: 2000px } .root { position: absolute; top: 100px, width: 100px; height: 80px; }</style>"); | ||
@@ -30,3 +30,3 @@ root.addClass("root"); | ||
expect(rect.top).toBe(8); //-192 (client rect top) + 200 (scrollY) | ||
expect(rect.top).toBe(-192); | ||
}); | ||
@@ -41,4 +41,24 @@ | ||
expect(rect.top).toBe(clientRect.top - 20); | ||
expect(rect.top).toBe(clientRect.top); | ||
}); | ||
it('should honour positioned with className element', () => { | ||
root.append("<style>.root { position: absolute; top: 200px; }</style>"); | ||
root.addClass("root"); | ||
const clientRect = root[0].getBoundingClientRect(); | ||
const rect = offset(root[0]); | ||
expect(rect.top).toBe(clientRect.top); | ||
}); | ||
it('should honour positioned with styles.top/left element', () => { | ||
root.css("position", "absolute"); | ||
root.css("top", 200); | ||
const clientRect = root[0].getBoundingClientRect(); | ||
const rect = offset(root[0]); | ||
expect(rect.top).toBe(clientRect.top); | ||
}); | ||
})); |
{ | ||
"name": "@progress/kendo-popup-common", | ||
"description": "Kendo UI Popup common package", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"publishConfig": { | ||
@@ -6,0 +6,0 @@ "registry": "https://registry.npm.telerik.com" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59494
1532