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

shadowrootmode attribute does not work in Blazor files #55164

Open
1 task done
ostomachion opened this issue Apr 16, 2024 · 0 comments
Open
1 task done

shadowrootmode attribute does not work in Blazor files #55164

ostomachion opened this issue Apr 16, 2024 · 0 comments
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one
Milestone

Comments

@ostomachion
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Adding <template shadowrootmode="open"> to a Blazor file produces a regular template element with a DocumentFragment child node.

Expected Behavior

The <template shadowrootmode="open"> should be parsed as a declarative shadow DOM as it would be in a regular HTML file.

Steps To Reproduce

  1. Create a new Blazor project in .NET 8
  2. Add <template shadowrootmode="open">Test</template> to a .razor page.
  3. Run the app in a browser.

Exceptions (if any)

No response

.NET Version

8.0.202

Anything else?

(This rule)[https://developer.chrome.com/docs/css-ui/declarative-shadow-dom#parser-only] seems to be the cause of the bug. When Blazor builds the component, it should account for shadowrootmode attributes and create a shadow DOM if necessary.

NOTE: This was originally reported at #44986, however this was before the shadowrootmode attribute was standardized and widely supported. I am reopening this as a bug report now that this has changed.

Also note that #44986 was marked as a duplicate of #34641 which is requests a very different feature from this bug report.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Apr 16, 2024
@mkArtakMSFT mkArtakMSFT added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Apr 16, 2024
@mkArtakMSFT mkArtakMSFT added this to the Backlog milestone Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one
Projects
None yet
Development

No branches or pull requests

2 participants