Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.5.2
-
None
-
openSUSE Tumbleweed 20231001
Description
See the following code
import QtQuick import QtQuick.Controls ApplicationWindow { width: 800 height: 600 visible: true Button { text: "Open menu" onClicked: menu.open() } Menu { id: menu MenuItem { text: "Menu Item 1" } Action { text: "Action 1" } MenuSeparator {} MenuItem { text: "Menu Item 2" } Action { text: "Action 2" } MenuSeparator {} MenuItem { text: "Hidden menu item"; visible: false } MenuItem { text: "Disabled menu item"; enabled: false} MenuSeparator {} Menu { title: "Sub Menu" } contentItem: ListView { implicitWidth: contentWidth implicitHeight: contentHeight model: menu.contentModel keyNavigationWraps: true keyNavigationEnabled: true currentIndex: 0 } } }
Run the code, click the button and start pressing the down key. You will notice that separators and the hidden menu item start grabbing keyboard focus.
Also note that setting `keyNavigationEnabled: false` does not disable keyboard navigation.
I need to override `contentItem` otherwise there is no way to enable keyboard navigation wrapping.