iron-scroll-threshold icon indicating copy to clipboard operation
iron-scroll-threshold copied to clipboard

lower threshold triggered unexpectedly

Open sfeast opened this issue 9 years ago • 2 comments

Description

Setting the lowerThreshold property to a falsy value does not fully disable lower threshold trigger events when reaching the bottom of the scrolling region.

Expected outcome

When setting lowerThreshold to a falsy value, this component no longer fires the lower-threshold event or set lowerTriggered to true.

Actual outcome

When setting lowerThreshold to a falsy value, the component does fire the lower-threshold event & set lowerTriggered to true in this specific case.

Live Demo

No demo here, but I think the error in the code is easy to see - https://github.com/PolymerElements/iron-scroll-threshold/blob/master/iron-scroll-threshold.html#L205

Specifically when lowerScrollValue is 0 (i.e. the bottom of the scroll region is reached) then this if statement will always evaluate to true.

Steps to reproduce

I don't have a demo but generally: Set lowerThreshold to false & then scroll to the bottom of the scrolling region.

Browsers Affected

All browsers

sfeast avatar Aug 27 '16 21:08 sfeast

Confirmed

blasten avatar Oct 07 '16 00:10 blasten

I found out if you fire resize event, it will work. in

attached () {
     window.dispatchEvent(new Event('resize'));
}

etamity avatar Apr 20 '17 16:04 etamity