-
Notifications
You must be signed in to change notification settings - Fork 315
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
Values in ComboBoxes does not update when selection made #467
Comments
@Aux9 Hi,
|
@olegpix I have tested it and went through the code so probably not. Basically, the Side note - And here's the private setValue(val: string) {
this.selected = val;
this.value = val;
this.input.value = val;
this.fireEvent('select', this.el);
dispatch('select.hs.combobox', this.el, this.value);
} This does not help that the whole flow of click event leading to Ideally, the event handler should dispatch:
Basically, the combobox at the moment has no way of:
I can contribute the changes. At the moment what's in public repo (v2.5.0) - rendering of items works (JSON or HTML) but events and value extraction is broken. Even direct DOM manipulation/querying is not going to help the user of this component to determine what was selected because Some properties/methods and adjustments are in order. This becomes more important because such an top class UI library will rarely be used as plain HTML and would end up almost always wrapped up by people as components (Svelte/React/Vue) etc. FYI @jahaganiev |
(I think) I have a similar issue with updating values (v2.5.0). I wanted to use Combobox for autocomplete search where I want to display values (eg. product names) but I need the value to be the This does not work (in a template) <div data-hs-combo-box-output-item-field="id" data-hs-combo-box-value></div>
<div data-hs-combo-box-output-item-field="name" data-hs-combo-box-search-text></div>
<div data-hs-combo-box-output-item-field="description"></div> This works but is not usable (due to possible name duplicates) <div data-hs-combo-box-output-item-field="id"></div>
<div data-hs-combo-box-output-item-field="name" data-hs-combo-box-search-text data-hs-combo-box-value></div>
<div data-hs-combo-box-output-item-field="description"></div> |
Hey everyone, the issue has been addressed with the latest v2.6.0 release. Thanks! |
Summary
Values in ComboBoxes does not update when selection made
Steps to Reproduce
When I try this Example here a basic usage of ComboBox its working perfectly, however the value of the input is not changing whenever new selection is made because somehow it loses focus maybe, when you try just something like this
<input id="input1" onblur="testValue(this)"
to test the value with a function like this :the value of the input is always empty! is there something wrong or my approach is wrong?
the aim is to verify the input value when users change selection please.
Demo Link
https://preline.co/docs/combobox.html
Expected Behavior
When user select something, the input value should change accordingly and save the user selection for further use besides it should not lose focus!
Actual Behavior
The input value is empty because it loses focus as I believe.
Screenshots
No response
The text was updated successfully, but these errors were encountered: