Declined
Last Updated: 13 Aug 2020 05:57 by ADMIN
Gopi
Created on: 03 Aug 2020 08:25
Category: DropDownList
Type: Bug Report
4
Extra spaces are trimmed from model value (AngularJs)

Bug report

Reproduction of the problem

Dojo example

  1. Inspect the value in the pre tag above the DropDownList and the selected value in the DropDownList.

Current behavior

The model has the extra spaces trimmed and there is a single space between the words:

<pre class="ng-binding">Magazzini Alimentari Riuniti</pre>

In the DropDownList the value properly contains 2 spaces between the words.

Expected/desired behavior

In the data the selected item has 2 spaces between the words: Magazzini Alimentari Riuniti
The model value should be identical to the data and the extra spaces should not be trimmed.

Environment

  • Kendo UI version: 2020.2.617
  • jQuery version: x.y
  • Browser: [all]
1 comment
ADMIN
Ianko
Posted on: 13 Aug 2020 05:57

Hello Gopi,

Using the `ng-model` directive for this scenario is incorrect. This causes  the hidden input to be updated with the item's value and the select DOM element trims the double spaces. This is a normal angular + select element behavior. 

In order to avoid that you should use the `k-ng-model` directive provided by the Kendo AngularJS library: https://docs.telerik.com/kendo-ui/framework/AngularJS/widget-basics/binding.  

A solution using the `k-ng-model` is available here:  https://dojo.telerik.com/OQeCeSeF

Regards,
Ianko
Progress Telerik