telerik / kendo-vue

Issue tracker - Kendo UI for Vue http://www.telerik.com/kendo-vue-ui/
Other
63 stars 28 forks source link

[Bug][ComboBox] Unable to set custom value with primitive #568

Open SOONwasTaken opened 4 months ago

SOONwasTaken commented 4 months ago

Describe the bug Using a ComboBox under these specific conditions:

Attempting to set a custom value will set the value of the ComboBox to an empty string. This only occurs if the value of the v-model does not currently map to data item value.

Notice also that the "X" to clear the value appears, despite not mapping to a value. Clearing the empty value or mapping the value to any valid selection allows for a custom value to be entered again.

To Reproduce Steps to reproduce the behavior:

  1. Go to this StackBlitz demo.
  2. Do not clear the value inside of the ComboBox. Note how the v-model is an empty string to start, and the "X" is present.
  3. Attempt to enter a custom value and blur the ComboBox by clicking off of it.
  4. Notice how the value you entered disappears.

Expected behavior I expect the custom value to be populated. I also expect that a value that is not present in the ComboBox's data items will not populate the ComboBox with an empty string value.

Screenshots N/A. Can only be reliably seen through the demo.

Browser

Additional context This causes problems with utilizing default values as we are unable to reliably set the value of a DTO's unique identifier (such as an ID) to a value that will empty the ComboBox (like a null value). We need to utilize the v-model to properly bind the ComboBox to our DTO, however, doing so gives us this issue. We would like to make this as good for User Experience as possible, and having the default value need to be cleared in order to enter a new custom value is bothersome.

Our ComboBox component maps KeyValuePair<string, string> values to each selection. We get these values via an API request to our backend, and populate the data items with the response. The text field is the value, whereas the value field is the key (in this case, our IDs).

iadnonov commented 3 months ago

Hey @SOONwasTaken,

Thank you for bringing this behavior to our attention. It's look like a valid bug. Our team will fix it as soon as possible.

If you have any other questions, please don't hesitate to submit a ticket in our support system. Greetings,
Ivaylo

SOONwasTaken commented 3 months ago

Hello Ivaylo,

Thanks for letting me know about this. Hopefully all goes well.

Kind Regards.