-
Notifications
You must be signed in to change notification settings - Fork 53
feat(uui-input): Adds <datalist>
options support
#1106
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
base: main
Are you sure you want to change the base?
Conversation
Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-1106.westeurope.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-1106.westeurope.azurestaticapps.net |
@leekelleher Do we need to do all of the work for the consumer with an My concern is that you cannot use this component outside a JavaScript context, i.e. in "light DOM", if you cannot set the options as HTML. |
That's correct, the The only option (as far as I'm aware) is to have the I'd have preferred to keep the |
That sounds very odd indeed. If you set up the uui-input component with: render() {
return html`
<input type="text" bla="bla" list=${this.list}>
<slot></slot>
`
} To understand the issue correctly, are you saying that this won't work? <uui-input list="my-options">
<datalist id="my-options">
<option value="a">A</option>
</datalist>
</uui-input> |
That's correct, as the slotted content would be in the Light DOM. |
I found an example of another library that solved it by creating an "input-container" element, where you manually type in the native Example here: https://jsbin.com/xojule/edit?html,output Wonder if we could do something similar, which would also be very useful for uui-select, which currently does not work in Light DOM either: <uui-input-container>
<input type="text" list="options">
<datalist id="my-options">
<option value="a">A</option>
</datalist>
</uui-input-container> |
Description
Implements #999.
Adds
<datalist>
options support to<uui-input>
.Adds an
options
property to<uui-input>
, accepting an array of{ name, value }
objects, (similar to<uui-select options>
). This will result in a<datalist>
element being rendered within the Shadow DOM, so that theinput
can be associated with it via thelist
attribute.Types of changes
How to test?