Actions
Bug #14470
openCorrect WComboBox/WSelectionBox placeholder functionality
Start date:
04/14/2026
Due date:
% Done:
0%
Estimated time:
Description
The select elements does not support a placeholder attribute.
The correct way to implement this for WComboBox is to add a first option, and select this by default. So that the DOM tree looks like:
<select>
<option value="-1" selected="selected" disabled>Placeholder text</option>
<option value="0">Value 1</option>
<option value="1">Value 2</option>
</select>
There, the option with value="-1" will be selected initially, on rendering, and will not be selectable by the user. This also implies that setting a placeholder will set the setNoSelectionEnabled(true).
For a WSelectionBox, a placeholder simply does not make any sense.
Updated by Matthias Van Ceulebroeck 16 days ago
- Status changed from InProgress to Review
- Assignee deleted (
Matthias Van Ceulebroeck)
Actions