{"action":"created","issue":{"url":"https://api.github.com/repos/html-next/vertical-collection/issues/220","repository_url":"https://api.github.com/repos/html-next/vertical-collection","labels_url":"https://api.github.com/repos/html-next/vertical-collection/issues/220/labels{/name}","comments_url":"https://api.github.com/repos/html-next/vertical-collection/issues/220/comments","events_url":"https://api.github.com/repos/html-next/vertical-collection/issues/220/events","html_url":"https://github.com/html-next/vertical-collection/issues/220","id":342079720,"node_id":"MDU6SXNzdWUzNDIwNzk3MjA=","number":220,"title":"idForFirstItem has no effect / broken","user":{"login":"josiahbryan","id":4821548,"node_id":"MDQ6VXNlcjQ4MjE1NDg=","avatar_url":"https://avatars1.githubusercontent.com/u/4821548?v=4","gravatar_id":"","url":"https://api.github.com/users/josiahbryan","html_url":"https://github.com/josiahbryan","followers_url":"https://api.github.com/users/josiahbryan/followers","following_url":"https://api.github.com/users/josiahbryan/following{/other_user}","gists_url":"https://api.github.com/users/josiahbryan/gists{/gist_id}","starred_url":"https://api.github.com/users/josiahbryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josiahbryan/subscriptions","organizations_url":"https://api.github.com/users/josiahbryan/orgs","repos_url":"https://api.github.com/users/josiahbryan/repos","events_url":"https://api.github.com/users/josiahbryan/events{/privacy}","received_events_url":"https://api.github.com/users/josiahbryan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-17T20:50:48Z","updated_at":"2018-07-17T20:57:02Z","closed_at":null,"author_association":"NONE","body":"`renderFromLast` / `idForFirstItem` seem to have no effect - I'm recording the last visible ID in the `lastVisiblechanged` handler (I see the output in console), and I set `lastVisibleId` in my controller before `filteredQueryResults` is available, yet the list still starts at the top (very first index), even though I scrolled down the page below the top. Am I missing something obvious here? (The lastVisibleId is in the list when I scroll down to it again, so I know it's there. It may be paged in depending on the list position - e.g. via `lastReached` requesting another page of data). Is this `idForFirstItem` feature even working currently?\r\n\r\n(Running version `1.0.0-beta.12` of `@html-next/vertical-collection`)\r\n\r\nHere's the template call to the component:\r\n\r\n```handlebars\r\n{{#vertical-collection filteredQueryResults\r\n\t\t\testimateHeight=50\r\n\t\t\tstaticHeight=false\r\n\t\t\tcontainerSelector=\"body\"\r\n\t\t\tkey='id'\r\n\t\t\tbufferSize=1\r\n\t\t\tlastReached=\"loadMore\"\r\n\t\t\trenderFromLast=true\r\n\t\t\tidForFirstItem=lastVisibleId\r\n\t\t\tlastVisibleChanged=(action 'lastVisibleChanged')\r\n\t\t\tas |attraction index|\r\n\t\t}}\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/html-next/vertical-collection/issues/comments/405725230","html_url":"https://github.com/html-next/vertical-collection/issues/220#issuecomment-405725230","issue_url":"https://api.github.com/repos/html-next/vertical-collection/issues/220","id":405725230,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTcyNTIzMA==","user":{"login":"josiahbryan","id":4821548,"node_id":"MDQ6VXNlcjQ4MjE1NDg=","avatar_url":"https://avatars1.githubusercontent.com/u/4821548?v=4","gravatar_id":"","url":"https://api.github.com/users/josiahbryan","html_url":"https://github.com/josiahbryan","followers_url":"https://api.github.com/users/josiahbryan/followers","following_url":"https://api.github.com/users/josiahbryan/following{/other_user}","gists_url":"https://api.github.com/users/josiahbryan/gists{/gist_id}","starred_url":"https://api.github.com/users/josiahbryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josiahbryan/subscriptions","organizations_url":"https://api.github.com/users/josiahbryan/orgs","repos_url":"https://api.github.com/users/josiahbryan/repos","events_url":"https://api.github.com/users/josiahbryan/events{/privacy}","received_events_url":"https://api.github.com/users/josiahbryan/received_events","type":"User","site_admin":false},"created_at":"2018-07-17T20:57:02Z","updated_at":"2018-07-17T20:57:02Z","author_association":"NONE","body":"@pzuraq Good point - actually, the `lastVisibleChanged` action **just** stores it in `localStorage`:\r\n\r\n```javascript\r\n\t\tlastVisibleChanged(model, index, lastVisibleId) {\r\n\t\t\tconsole.log(\"[lastVisibleChanged]\", model.getProperties('name', 'id'), lastVisibleId )\r\n\t\t\tconst storage = window.localStorage;\r\n\t\t\tif(storage) {\r\n\t\t\t\tstorage.setItem(this.lastVisibleIdCacheKey(), lastVisibleId);\r\n\t\t\t}\r\n\t\t},\r\n```\r\n\r\nIt never actually touches the `lastVisibleId` property on the controller from that action handler - the `lastVisibleId` is **only** set in **one** place in code - it's the part that makes the initial ajax call to load data. It loads that id from local storage, and I can confirm it only does it once because I only see the `console.log` line in console once, not every time I scroll. Here's the relevant code for completeness: \r\n\r\n```javascript\r\n\t\tconst storage = window.localStorage;\r\n\t\tif(storage) {\r\n\t\t\tthis.set('lastVisibleId', storage.getItem(this.lastVisibleIdCacheKey()));\r\n\t\t\tconsole.log(\"[initQueryInternal] set lastVisibleId to\", this.get('lastVisibleId'));\r\n\t\t}\r\n```"}}
{"actor":{"display_login":"josiahbryan"}}