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

scrollTo does not work for initialised value #710

Open
lougreenwood opened this issue Jul 23, 2019 · 1 comment
Open

scrollTo does not work for initialised value #710

lougreenwood opened this issue Jul 23, 2019 · 1 comment

Comments

@lougreenwood
Copy link

When an lt-body is initialised with a value for @scrollTo, the table does not automatically scroll to this position.

Instead scrollTo only seems to work if a value is provided after the initial render.

I'm willing to take a look at fixing this, but I'm finding it hard to find the code where the scroll is actually registered for a scrollTo, so any pointers are welcome :)

@lougreenwood
Copy link
Author

Ok, I think I've figured out the issue...

Because scrollTo is triggered when via didReceiveAttributes, the @scrollTo arg is processed before the table renders.

Additionally, because the implementation relies on a private _scrollTo property - where if this value matches the @scrollTo arg, the implication is that scroll was successful and should not be re-triggered. But the issue here is that this can be set before the table has even rendered, so the ember-scrollable was not able to perform the scroll.

It seems that generally a more robust system is needed to properly handle scroll, but for now I'm going to try and patch something so that scrollTo also works for first render

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

Successfully merging a pull request may close this issue.

1 participant