Skip to content

Commit

Permalink
fix #1297 Resizable dialog is not working inside a page with some scroll
Browse files Browse the repository at this point in the history
This fix is changing the way we set the position of the resizable overlay, using the real position of the element insted of its position inside the viewport.
  • Loading branch information
fab-b committed Sep 24, 2014
1 parent 32b3740 commit d3c1ae5
Show file tree
Hide file tree
Showing 8 changed files with 580 additions and 446 deletions.
5 changes: 3 additions & 2 deletions src/aria/utils/overlay/Overlay.js
Expand Up @@ -102,8 +102,9 @@ module.exports = Aria.classDefinition({
var geometry = ariaUtilsDom.getGeometry(element);
if (geometry) {
overlayStyle.position = "absolute";
overlayStyle.top = geometry.y + "px";
overlayStyle.left = geometry.x + "px";
var scroll = dom.getDocumentScrollElement();
overlayStyle.top = geometry.y + scroll.scrollTop + "px";
overlayStyle.left = geometry.x + scroll.scrollLeft + "px";
overlayStyle.width = (geometry.width - border.left - border.right) + "px";
overlayStyle.height = (geometry.height - border.top - border.bottom) + "px";
overlayStyle.display = "block";
Expand Down

Large diffs are not rendered by default.

Expand Up @@ -21,6 +21,8 @@ Aria.classDefinition({

this._tests = ["test.aria.widgets.container.dialog.resize.test1.DialogOnResizeTestCase",
"test.aria.widgets.container.dialog.resize.test2.ResizableDialogTestCase",
"test.aria.widgets.container.dialog.resize.test3.DialogOnResizeTestCase"];
"test.aria.widgets.container.dialog.resize.test3.DialogOnResizeTestCase",
"test.aria.widgets.container.dialog.resize.test4.DialogOnResizeScrollTestCase",
"test.aria.widgets.container.dialog.resize.test5.OverlayOnResizeScrollTestCase"];
}
});

0 comments on commit d3c1ae5

Please sign in to comment.