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
on-lower-threshold is only triggered at page load #23
Comments
You need to clear the triggers: this.$.scrollTheshold.clearTriggers(); |
Yep. |
The clearTriggers function was already on that code the whole time. Why is this issue closed? That was not the solution. |
@doughaase are you able to send a complete jsbin? |
Even I'm facing the same issue!! on-lower-threshold="loadMoreData" is not triggering function |
I'm facing the same issue. The on-xxx-threshold functions are triggered on page load, but not when scrolling to the top or bottom of the defined area. I'm using it with a dom-repeat:
Regards, |
I'm facing exact same issue. The lower-threshold is only triggered on page load and it seems like the iron-scroll-threshold element isn't even listening to scroll events. When I scroll to the bottom o the list it never fires. I also cleared triggers after the inital fire and still same thing. My host element is set to
|
hey i have also the same issue with iron-scroll-threshold, using the app-toolbox basic app-template(from the tutorial on the polymer page). The function gets fired on pageload, and after this never again, even when i clear the triggers.. then I've tried to use the dom modul view itself: "my-view3" as scroll-target. --> also not working and then i used this at my page:
and in the script section of the page i tried to use something this
but it console it says: Polymer.dom(...).querySelector(...) is null does anyone know how to adress this element in a propper way? i think it is null because it is in the my-app.html file, and i am doing this in the my-view3.html file which is included via iron-pages. it would be a breeze if someone knows a way of adding iron-scroll-threshold to a iron page of the default app-toolbox template 👍 kind regards chwzr |
I'm also facing similar problem. Waiting for responce... |
I found out if i use the app-header without "has-scrolling-region" it work as aspected. in the documentation of the app-header layout, its mentioned that it uses the document as scroll target for the has-scrolling-region, but it dont think so/ when i define document as scroll target for the iron-scrolling-threshold it only triggers once for obvious reasons. so in the meantime i do not use the has-scrolling-region ( but I think it looks better with this.. ). kind regards :) |
When I removed the "has-scrolling-region" attribute from the app-header element, the on-lower-threshold event started firing every time I scroll the document no matter how close I am to the bottom or which direction I am scrolling. |
One thing Ive noticed is to make sure to put the scroll target as the element that actually does the scrolling. In some cases it might be a parent element. |
So this is what I have: My app-header-layout has an id of "appHeaderLayout" like the following I have its scroll-target attribute set to the id of app-header element, but the on-lower-threshold event is triggered only once when the page first loads. Yes, I have called the clearTriggers() method as following: |
I ended up writing my own infinite scroll functions because this element is broken at the moment. |
I guess that is what I would do too then |
I have the same problem |
@marko911 - Is it possible for you to share your solution. I am stuck at the same place. Thanks. |
Rough version here so play with it to accommodate your own use. @dheerajsarwaiya Basically add this behavior to the Also on the same element you add this behavior, add a 'scroll-trigger' listener so you can fire what you need to when scroll threshold is reached.
|
+1. |
I've finally make it work. In my case, I'm using the So I decided to put the Roughly here is what I've done : HTML :
JS :
Hope this can help in your use cases. Probably you have juste to wait an other element to be fully ready before to init your |
This is not working for me unfortunately. And isn't it the same effect als calling clearTriggers? The problem also is, when #scrollThreshold is inside the dom-if, I cannot access it for clearTriggers anymore... |
It does not work with Polymer 3 !!!!!! or what the fuck ??? |
I worked on Polymer from 2016 to mid of 2018 .. and then I started learning React .. It would not be wrong to say that React is far superior than polymer. Leave polymer before google shut it down. (they are planning to ) |
Nah, I am going to push and support the idea of WebComponents, and I have used React for many other projects. Im just going to create my own Element/Component. Thanks |
Solved with switching to alicorn-scroll-watcher, seems to work just fine. Install |
Description
I'm trying to use the iron-scroll-threshold combined with iron-list.
When I open up the page that has the list, on-lower-threshold is fired. Nothing happens as I scroll the list.
I have the following file structure:
body
tag that encapsulates<my-app>
element).app-drawer layout
+app-header-layout
and the declared<iron-pages>
inside it).iron-pages
. Has the iron-ajax the populates theiron-list
that its encapsulated byiron-scroll-threshold
.index.html:
my-app.html has nothing specific regarding css heights or layouts, only the display:block value:
person-list.html:
I didn't declared any div for the iron-scroll-threshold. It's just: dom > template > style > ajax > iron-scroll > iron-list.
Expected outcome
The scroll to the near bottom of the list should fire the function loadMoreData.
Actual outcome
The function is fired when I load the page, and nothing else happens. The scroll is not triggering the on-lower-threshold.
I'm following the documentation:
https://www.webcomponents.org/element/PolymerElements/iron-scroll-threshold
... and as far as I know, the example matches what I just coded.
The text was updated successfully, but these errors were encountered: