https://bugs.kde.org/show_bug.cgi?id=472784

            Bug ID: 472784
           Summary: Automatically close MenuDialog when a menu item is
                    clicked
    Classification: Frameworks and Libraries
           Product: frameworks-kirigami
           Version: Master
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: wishlist
          Priority: NOR
         Component: general
          Assignee: kdelibs-b...@kde.org
          Reporter: jackhill3...@gmail.com
                CC: notm...@gmail.com
  Target Milestone: Not decided

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

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to