Bug 465567 - Dialogs do not Autofocus for keyboard navigation
Summary: Dialogs do not Autofocus for keyboard navigation
Status: CONFIRMED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: Not decided
Assignee: kdelibs bugs
URL:
Keywords: accessibility, usability
Depends on:
Blocks:
 
Reported: 2023-02-11 02:35 UTC by Jazztache
Modified: 2023-02-12 17:54 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Video of the current (unexpected) behaviour. (455.58 KB, video/mp4)
2023-02-11 02:35 UTC, Jazztache
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jazztache 2023-02-11 02:35:49 UTC
Created attachment 156138 [details]
Video of the current (unexpected) behaviour.

SUMMARY
***
Using keyboard navigation, you can select buttons and then press space to trigger them. With Dialogs, when the dialog pops up, there is no focus on the text field or any of the elements in the foreground. You can still navigate and trigger elements in the background.

In the video, I demonstrate this by using Tab and Shift-Tab to navigate the background... whilst the dialog is still up.

I have had a similar problem on both my own app and also Kirigami Galley, which I have used to demonstrate this issue.
***


STEPS TO REPRODUCE
1. Open Up Kirigami Gallery, this is where the bug was verified.
2. Click 'Dialogs'
3. 

You can also do this in other Kirigami apps, though it may be solved on a case by case basic. OOTB, it isn't. I verified this [here](https://codeberg.org/LimeHex/Kontindue/issues/16)

OBSERVED RESULT

Dialog's text box was not focused.

See video attached.


EXPECTED RESULT

Kirigami should detect the first element in the dialog and focus that. If it's a text field, give it special priority. If QML supports or has an equivalent of `typeof(Component)` or some other way to detect which component is which, scan the component's children, and focus the text field. Otherwise, focus the OK button or some other prioritized component.

SOFTWARE/OS VERSIONS
Arch Linux : 6.1.6-arch1-1 (64 bit)
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Comment 1 Jazztache 2023-02-11 02:46:06 UTC
- EDIT -
STEPS TO REPRODUCE
1. Open Up Kirigami Gallery, this is where the bug was verified.
2. Click 'Dialogs'
3. Use Keyboard Navigation (Shift+Tab) to navigate to and focus the buttons on the screen.
4. Press Space to Open the Dialog
5 (Optional). Since focus is still in the background, you can activate the other dialogs and layer them over each other, which is even less desirable.