Actions
Bug #3075
closedWComboBox doesn't honour "invalid" selection
Start date:
05/06/2014
Due date:
% Done:
0%
Estimated time:
Description
When setting invalid index for a WComboBox programmatically, the first item in combo box will be displayed as selected instead.
Repro:
Wt::WComboBox *combo = new Wt::WComboBox(this);
combo->addItem("Apples");
combo->addItem("Oranges");
combo->setCurrentIndex(-1); // ERROR: it will display "Apples" instead of an blank field
Please find attached a patch proposal; it works fine for me, but Wt team might want to tweak it to make it more efficient.
Regards.
Files
Updated by Koen Deforche over 10 years ago
- Status changed from New to Resolved
- Assignee set to Koen Deforche
- Target version set to 3.3.3
Hey,
Contrary to what I've been thinking until now, it is indeed supported in most browsers to have 'no selection' in a combo-box (but only using JavaScript).
I've made a change so that setting currentIndex to --1 works properly now.
Thanks for pointing this out.
Regards,
koen
Updated by Koen Deforche over 10 years ago
- Status changed from Resolved to Closed
Actions