Project

General

Profile

Actions

Bug #14470

open

Correct WComboBox/WSelectionBox placeholder functionality

Added by Matthias Van Ceulebroeck 18 days ago. Updated 15 days ago.

Status:
Review
Priority:
Normal
Target version:
-
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.

Actions #1

Updated by Matthias Van Ceulebroeck 16 days ago

  • Status changed from InProgress to Review
  • Assignee deleted (Matthias Van Ceulebroeck)
Actions #2

Updated by Romain Mardulyn 15 days ago

  • Assignee set to Romain Mardulyn
Actions

Also available in: Atom PDF