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 element is not working while using vertical collection in power select option #266

Open
GnanaAjana opened this issue May 28, 2019 · 3 comments

Comments

@GnanaAjana
Copy link

I am using the vertical collection for power select. I am doing scrollTo action to highlight an option and scroll down key action.

Issue:
While triggering scrollTo, vertical collection DOM options are not loaded. So I can't able to scrollTo the highlighted option. After execution of scrollTo of power-select, vertical collection options are loaded...

Is there any other way to resolve this.

Version:
"ember-cli": "2.12.3",
"@html-next/vertical-collection": "1.0.0-beta.12"

@herzzanu
Copy link

We're doing something similar. The solution we came up with is to check if the element we want to scroll to is already rendered/loaded. If not, we render it and calculate the scrollTop position of that element. Hope it makes sense.

@GnanaAjana
Copy link
Author

@herzzanu Thanks.
Issue is resolved. I tried to set a scrollTop position after the vertical collection option is rendered using setTimeout.

@herzzanu
Copy link

Nice. To make it nicer you can use an ember concurrency task and use timeout. Then you can use the task states for different behaviors like disabling some controls or showing placeholders for example ;)

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