vertical-collection
vertical-collection copied to clipboard
Scrollto element is not working while using vertical collection in power select option
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"
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.
@herzzanu Thanks. Issue is resolved. I tried to set a scrollTop position after the vertical collection option is rendered using setTimeout.
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 ;)