Declined
Last Updated: 09 May 2019 17:12 by ADMIN
Maelys
Created on: 06 May 2019 09:37
Category: DropDownList
Type: Feature Request
1
Placeholder for dropdownlist

Placeholder for dropdownlist could be a great thing, because defaultItem not have the same use. I just want to show text when nothing is select, but I do not want that the dropdownlist have nothing selected (or the defaultItem) when we have already selected an item. The defaultItem can be selected again and it is not the same use of placeholder.

 

Thanks for reading.

1 comment
ADMIN
Petar
Posted on: 09 May 2019 17:11
Hi Maelys,

The DropDownList does not support placeholders but a possible workaround is to set a default item which is always disabled. I have prepared a StackBlitz example here. There are few important steps:
  1. A defaultItem has to be set
  2. itemDisabled has to be set to return the value of the defaultItem

The reason we do not provide placeholder for the DropDownList is that according to UI concepts a placeholder should exist on inputs only. The DropDownList on the other hand resembles a <select> tag in HTML and <select> does not support placeholders as well. If the requirement is to have placeholder, a possible solutions is to use the ComboBox - here is a StackBlitz example.

Please let me know if this helps.

Regards,
Petar
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.