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
Component's ShadowRoot is null on attach when navigating from a Typescript view. #12080
Comments
The test case can actually be simplified to
|
The problem is that the view element is not attached to the DOM when the You can see this more clearly if you change to
When you open the Java view directly, you get |
We need to investigate this. Let’s do a 1-day investigation here. My gut feeling is that this is related to Flow / vaadin-router navigation lifecycle. |
Fixes #12080 The client-side Vaadin Router does not attach components until the `onBeforeEnter` callback is run. However, when the Flow client initializes a server-side view, it assumes its container and the UI root are connected to the document. This concerns constructor timing as well as `AttachEvent` listeners. This fixes the issue by pre-attaching the hidden container element created in the `Flow.ts` (the adapter for the client-side router) to the body.
Fixes #12080 The client-side Vaadin Router does not attach components until the `onBeforeEnter` callback is run. However, when the Flow client initializes a server-side view, it assumes its container and the UI root are connected to the document. This concerns constructor timing as well as `AttachEvent` listeners. This fixes the issue by pre-attaching the hidden container element created in the `Flow.ts` (the adapter for the client-side router) to the body.
Fixes #12080 The client-side Vaadin Router does not attach components until the `onBeforeEnter` callback is run. However, when the Flow client initializes a server-side view, it assumes its container and the UI root are connected to the document. This concerns constructor timing as well as `AttachEvent` listeners. This fixes the issue by pre-attaching the hidden container element created in the `Flow.ts` (the adapter for the client-side router) to the body.
Fixes #12080 The client-side Vaadin Router does not attach components until the `onBeforeEnter` callback is run. However, when the Flow client initializes a server-side view, it assumes its container and the UI root are connected to the document. This concerns constructor timing as well as `AttachEvent` listeners. This fixes the issue by pre-attaching the hidden container element created in the `Flow.ts` (the adapter for the client-side router) to the body.
Fixes #12080 The client-side Vaadin Router does not attach components until the `onBeforeEnter` callback is run. However, when the Flow client initializes a server-side view, it assumes its container and the UI root are connected to the document. This concerns constructor timing as well as `AttachEvent` listeners. This fixes the issue by pre-attaching the hidden container element created in the `Flow.ts` (the adapter for the client-side router) to the body.
This ticket/PR has been released with platform 22.0.0.beta2 and is also targeting the upcoming stable 22.0.0 version. |
Description of the bug / feature
Consider this view
If you navigate to this view from a typescript view, the
shadowRoot
will be null. Otherwise it will be available.A more complex example:
The errors are caused by the field-highlighter trying to access the components shadow roots.
Minimal reproducible example
my-app.zip
[object ShadowRoot]
null
Expected behavior
The alert should show
[object ShadowRoot]
in all cases.Versions:
The text was updated successfully, but these errors were encountered: