Project

General

Profile

Actions

Bug #14730

open

WDialog::setFirstFocus ignores footer and does not focus the WDialog as fallback

Added by Michael Seibt 5 days ago. Updated 4 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
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 #1

Updated by Romain Mardulyn 4 days ago

  • Target version set to 4.15.0
Actions

Also available in: Atom PDF