Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ui/widgets/fields/input_field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "ui/painter.h"
#include "ui/qt_object_factory.h"
#include "ui/integration.h"
#include "ui/screen_reader_mode.h"
#include "styles/style_widgets.h"
#include "styles/palette.h"

Expand Down Expand Up @@ -4378,7 +4379,10 @@ void InputField::keyPressEventInner(QKeyEvent *e) {
e->ignore();
} else {
const auto forward = (key == Qt::Key_Tab) && !shift;
auto request = TabbedRequest{ .backward = !forward };
auto request = TabbedRequest{
.backward = !forward,
.defaultOrder = ScreenReaderModeActive(),
};
_tabbed.fire(&request);
if (!request.handled && !focusNextPrevChild(forward)) {
e->ignore();
Expand Down
8 changes: 8 additions & 0 deletions ui/widgets/fields/input_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ class InputField : public RpWidget {
struct TabbedRequest {
bool backward = false;
bool handled = false;

// Set when Tab should follow the default focus order instead: in
// screen reader mode the buttons and settings around the fields
// are Tab stops, and a handler that would only pass the focus on
// to another field is expected to leave the request alone. One
// that uses Tab for something else - accepting a suggestion -
// goes ahead as usual.
bool defaultOrder = false;
};
static const QString kTagBold;
static const QString kTagItalic;
Expand Down