[combobox]: allow formatting of textbox content #1326
Replies: 3 comments
-
It was not designed with this use case in mind. Only fieldset and forms allow nesting form controls atm (and choice groups allow choice inputs, which are the options in this particular case). |
Beta Was this translation helpful? Give feedback.
-
For this to work you would need:
You could temporarily hack via: <lion-combobox>
<lion-input no-registration slot="input"></lion-input>
...
</lion-combobox> addFormElement(child, ...args) {
if (child.hasAttribute('no-registration')) {
return;
}
super.addFormElement(child, ...args);
// etc...
}
Question still remains whether having a native input that is not a direct child is a problem for screenreaders. If not, we would have to make |
Beta Was this translation helpful? Give feedback.
-
Desired functionality (formatting etc., which you would get when using a lion-input inside) could be achieved by adding FormatMixin on top of LionCombobox. This issue could be moved to Discussions as a Feature request... |
Beta Was this translation helpful? Give feedback.
-
--- edit by @tlouisse ---
--- end edit ---
Expected behavior
Combobox should be rendered without any error when used with other lion components
Actual Behavior
When lion field is used in
input
slot of combobox element, below error is thrownThis error is not thrown when native input is used.
Using
lion-input
triggers the form-element registration cycle. Since Combobox element extends ListBoxMixin which extendsChoiceGroupMixin
this error is thrown.As per my understanding
ChoiceGroupMixin
expects all the child elements to have modelValue asBoolean
value and havinglion-input
as child element here results in this errorhttps://webcomponents.dev/edit/1Xuf6Y72LFuP8kuovLOj
Additional context
Which component and version of it are you using.
@lion/combobox: 0.1.1
Beta Was this translation helpful? Give feedback.
All reactions