dotnet / dotnet/aspnetcore

[Blazor] InputText binding is not supported well with Shadow DOM elements

Open
#60,885 9 comments 0 reactions 0 assignees View on GitHub
area-blazor bug help wanted
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Describe the bug

I use a web component library which create input elements within shadow DOM (shadowRoot property).
Let's call it ``
I overrided InputText content with .

When using @bind on the value with `oninput` event, it doesn't work as well as the InputText or html input element. Characters could be sent weirdly depending the connection, and the use or websocket or no, and specially when the typing is fast.

I already digged into the problem and found a fix on my branch : https://github.com/Poppyto/aspnetcore/tree/poppyto/use-shadow-input-with-binding

The idea is to relay on `event.composedPath().find(_=>true)` instead of `event.target` when dealing with some events.

I would be happy to discuss about this bug

### Expected Behavior

The typing must be smooth

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version

8

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.