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

Active route's display style set to none until all children are rendered #110

Open
harrysolovay opened this issue Apr 3, 2020 · 0 comments

Comments

@harrysolovay
Copy link

Stencil version: 1.12.1

I'm submitting a ...
[x] bug report

Current behavior:

When switching to a new active route, that route has a display style set to none, until all children are rendered. Within the route-rendered components, this route style causes limitations. For instance, one cannot utilize scrollTo in componentDidLoad / componentDidRender.

I've attempted the following workaround, wherein I emit when the route has loaded via a router-level mutation observer that looks at its changes in style. Ran into another bug trying to do so.

Expected behavior:

To have the currently-active route set to display: initial, so that children can utilize DOM methods without worry.

Related code:

In any given router-rendered component, try the following:

@Element el: HTMLElement;

componentDidLoad() {
  this.el.scrollTo({top: 100});
}
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

1 participant