SUMMARY This is standard behaviour for menus, and should be implemented here. Currently we are required to manually `menuDialog.close()` at the end of the action's `onTriggered` signal, like this: Kirigami.Action { id: myAction onTriggered: { myFunc(); menuDialog.close() } } The problem with this is it means we cannot use this action in other contexts. For example we may want a Kirigami.MenuDialog on mobile devices and a QQC2.Menu on desktop. I should be able to just plug the same action into both components, but instead I have to define two near-identical actions to deal with MenuDialog. STEPS TO REPRODUCE 1. Open Kirigami Gallery and navigate to the Dialogues page 2. Open the MenuDialog component 3. Click a list item OBSERVED RESULT Item is clicked, menu is still open EXPECTED RESULT Item is clicked, menu is closed SOFTWARE/OS VERSIONS Operating System: openSUSE Tumbleweed 20230724 KDE Plasma Version: 5.27.6 KDE Frameworks Version: 5.108.0 Qt Version: 5.15.10 Kernel Version: 6.4.4-1-default (64-bit) Graphics Platform: X11 ADDITIONAL INFORMATION
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kirigami/-/merge_requests/1244
Git commit a9b55a46f3cd941bcf85c6bbf63aeda30a4963ec by ivan tkachenko, on behalf of Jack Hill. Committed on 12/09/2023 at 22:57. Pushed by ratijas into branch 'master'. MenuDialog: close when menu item is clicked Co-Authored-By: ivan tkachenko <me@ratijas.tk> M +1 -0 autotests/CMakeLists.txt A +79 -0 autotests/tst_menudialog.qml [License: LGPL(v2.0+)] M +2 -0 src/controls/MenuDialog.qml https://invent.kde.org/frameworks/kirigami/-/commit/a9b55a46f3cd941bcf85c6bbf63aeda30a4963ec