We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Window#updatePostion() line 207 is setting modalElement.element().style.left but should be setting modalElement.element().style.top
modalElement.element().style.left
modalElement.element().style.top
additionally the block of code at line 220-227 breaks the block at 203-218 and can be completely removed
if (windowTop < 0) { modalElement.element().style.top = (fixed ? 0 : DomGlobal.window.pageYOffset) - ((initialHeight - windowHeight) / 2) + "px"; } else { modalElement.element().style.top = windowTop + "px"; }
To Reproduce create Window call setWindowTop(), then setFixed()
Expected behavior set modalElement.element().style.top
Prposed new updatePostion() function:
private void updatePosition() { if (maximized) { modalElement.element().style.left = "0px"; modalElement.element().style.top = "0px"; } else { DOMRect windowRect = modalElement.element().getBoundingClientRect(); double initialWidth = windowRect.width; double windowWidth = DomGlobal.window.innerWidth; double initialHeight = windowRect.height; double windowHeight = DomGlobal.window.innerHeight; if (windowLeft > 0) { if (windowLeft < (windowWidth - initialWidth)) { modalElement.element().style.left = windowLeft + "px"; } else { modalElement.element().style.left = windowLeft - ((windowLeft + initialWidth) - windowWidth - DomGlobal.window.pageXOffset) - elements.body().element().getBoundingClientRect().left + "px"; } } else { modalElement.element().style.left = ((windowWidth - initialWidth) / 2) + ((fixed ? 0 : DomGlobal.window.pageXOffset)) - elements.body().element().getBoundingClientRect().left + "px"; } if (windowTop > 0) { if (windowTop < (windowHeight - initialHeight)) { modalElement.element().style.top = windowTop + "px"; } else { modalElement.element().style.top = windowTop - ((windowLeft + initialHeight) - windowHeight - DomGlobal.window.pageYOffset) + "px"; } } else { modalElement.element().style.top = (fixed ? 0 : DomGlobal.window.pageYOffset) - ((initialHeight - windowHeight) / 2) + "px"; ; } } }
The text was updated successfully, but these errors were encountered:
fix #911 Window updatePosition setWindowTop sets wrong positions
4335c72
vegegoku
No branches or pull requests
Describe the bug
Window#updatePostion() line 207 is setting
modalElement.element().style.left
but should be settingmodalElement.element().style.top
additionally the block of code at line 220-227 breaks the block at 203-218 and can be completely removed
To Reproduce
create Window
call setWindowTop(), then setFixed()
Expected behavior
set
modalElement.element().style.top
Prposed new updatePostion() function:
The text was updated successfully, but these errors were encountered: