Bug 465567

Summary: Dialogs do not Autofocus for keyboard navigation
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: Jazztache <jazanaterz>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: nate, notmart
Priority: NOR Keywords: accessibility, usability
Version First Reported In: unspecified   
Target Milestone: Not decided   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Video of the current (unexpected) behaviour.

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.