Last Updated: 25 Nov 2019 07:25 by ADMIN
Created on: 18 Nov 2019 09:43
Category: MultiSelect
Type: Bug Report
Multiselect removes double spaces from options on initialization

Hi Kendo support team,

I found a bug (or at least an undesired behavior) in the Kendo Multiselect widget.

After initialization the options in the existing select seem to be rebuilt receiving the content as value attribute if it did not exist before.
During this process potentially existing double spaces are replaced with single spaces (see attached image).

If the options of that select are replaced later, they will keep double spaces.

We use the selected values to receive content from the database, which in these cases is not possible anymore.
Since the content of the database is created by our client, we can't guarantee there might not be any double spaces.

In general I think that the content of the existing options should not be modified in any way.



See the following dojo to reproduce the behavior:

Attached Files:
1 comment
Veselin Tsvetanov
Posted on: 25 Nov 2019 07:25

Hi Beto,

The observed is a result of the default behavior of HTML. Where there are multiple spaces inserted in the HTML, they will always be interpreted and displayed as a single space. For reference, you could review the following modified version of the Dojo sample. It also initializes a native <slect> element with <options>. You will notice that multiple spaces in those options will also be reduced to single.

If you need to visually keep the multi empty space in the HTML you will have to replace the blank space with the character for empty space (&nbsp;). Here you could find a Dojo implementing that suggestion.

I hope that the above explains the case. If you have any other questions, please do not hesitate to contact us.

Veselin Tsvetanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.