-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add <vaadin-text-field-container> #1411
Comments
Style leaks are unavoidable with this approach, of course, so it’s no silver bullet it that sense. It is fine when you can wrap it inside another shadow tree (like we encapsulate paper input in vaadin-combo-box/date-picker), but using it inside the light dom of vaadin-form-layout seems more prone to unwanted style leaks. |
@jouni style leaks are workaroundable. Naturally, themes need to define all appearance properties for For example, if a theme will use We can’t protect against Here are some quick JSbin demos.
|
Reasons for the container:
|
@paales please keep in mind that password managers and autocomplete are expected to break anyways, when using any Web Component with shadow root for the whole app / single view inside of it. What problems do you have regarding |
Slightly related (a more generic field wrapper element): vaadin/vaadin-core#150 |
Not when you have the form in the same scope as the input field. It is not the issue that the autocomplete can't penetrate the shadow dom boundary, just that the values are set from the 'level' of the form and thus cant find the inputs. Autocomplete matters. |
Create
<vaadin-text-field-container>
element, which is a themable container for an<input>
element provided by users in the light DOM.Resolves vaadin/vaadin-text-field#38 and vaadin/vaadin-text-field#48.
Motivation
Exposing
<input>
for direct access gives accessibility benefits.<label>
element bindings and attributes without any hacks/manual support from the<vaadin-text-field>
.Currently with
<vaadin-text-field>
, using<label>
is problematic: it does not announce<label>
as an accessible name when native Shadow DOM is used, because<label>
is in the parent tree, while the focused<input>
is in the shadow tree of<vaadin-text-field>
:With
<vaadin-text-field-container>
, users can assign accessible labels with<label>
element (#useThePlatform 👍):Users can assign
aria-label
and other ARIA attributes on the input directly:Users can use a custom input type and other native
<input>
attributes:The text was updated successfully, but these errors were encountered: