I set my body element to
body {
overflow-y: scroll;
}
This creates a scroll bar on my body element. When I create a scrollbar and scroll to the bottom the main area of my page is also scrolled.
I found some posts on this topic: Prevent scrolling of parent element? prevent Scroll "bubbling" from element to window but these are not applicable for GWT.
I tried the following:
@UiHandler("panel")
void onPanelMouseOver(MouseOverEvent event) {
Window.enableScrolling(false);
}
@UiHandler("panel")
void onPanelMouseOut(MouseOutEvent event) {
Window.enableScrolling(true);
}
This is a bad solution because the main scroll bar disappear and the page is moving from left to right and back. I want to lock the scroll bar not hide it. Hiding will move the screen.
Is there a better way to lock the main scroll bar in GWT?