Skip to content
New issue

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

QuickView - ParentScrollBar doesn´t works on Edge and Chrome #704

Closed
hectorfrancor opened this issue Feb 9, 2021 · 1 comment
Closed

Comments

@hectorfrancor
Copy link

Hi,

I noticed that the https://github.com/wicketstuff/core/blob/master/quickview-parent/quickview-examples/src/main/java/org/wicketstuff/examples/ParentScrollBar.java does not works on Edge and Chrome Browsers.

I tested it on chrome/edge and I saw that the function isComponentScrollBarAtBottom on the https://github.com/wicketstuff/core/blob/master/quickview-parent/quickview/src/main/java/org/wicketstuff/repeater.js always return false for Edge and Chome. For Firefox works ok.

I think the issues is due to the Chrome/Edge return floats for $(el).scrollTop().

Just for testing, I change

isComponentScrollBarAtBottom: function(id) {
var el = $("#" + id);
// offsetheight : element height
// scrolltop : height of scroll from top
// scroll-height:height of the scroll view of an element
return ($(el).prop("offsetHeight") + $(el).scrollTop() >= $(el).prop("scrollHeight"));
}

for

isComponentScrollBarAtBottom: function(id) {
var el = $("#" + id);
// offsetheight : element height
// scrolltop : height of scroll from top
// scroll-height:height of the scroll view of an element
return (Math.round($(el).prop("offsetHeight")) + Math.round($(el).scrollTop()) >= Math.round($(el).prop("scrollHeight")));
}

and it works on Chrome and Edge.

Thx.

@martin-g
Copy link
Member

martin-g commented Feb 9, 2021

The suggested change is applied!
Thank you, @hectorfrancor !

martin-g added a commit that referenced this issue Feb 9, 2021
Chromium based browsers return float for `scrollTop` and this seems to break `isComponentScrollBarAtBottom` method.

(cherry picked from commit 7b5704f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants