Actions
Bug #14730
openWDialog::setFirstFocus ignores footer and does not focus the WDialog as fallback
Start date:
08/11/2026
Due date:
% Done:
0%
Estimated time:
Description
Affected: WDialog::setFirstFocus of Wt 4.14.0 (and most likely former versions)
docs:
/*! \brief Set focus on the widget's first descendant.
*
* This sets the focus on the first focusable widget in the dialog.
* If no focusable widget is found, it will try to focus itself
* instead.
*/
Having a dialog with just text in contents and action buttons in the footer, then the focus remains on the closed main menu item.
No key events reach the dialog.
Anyway, explicitly calling WDialog::setFirstFocus should not be necessary at all because of the default:
/*! \brief Set focus on the first widget in the dialog.
*
* Autofocus is enabled by default. If a widget inside of
* this dialog already has focus, the focus will not be changed.
*/
void setAutoFocus(bool enable){ autoFocus_ = enable;}
This also does not work if the contents contains interactive widgets. Might it be done too early?
Actions