Bug 496214

Summary: SelectableLabel loses its text selection when moving the cursor over the context menu to copy the text
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: postix <postix>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: EpicTux123, kde, nate, notmart
Priority: NOR Keywords: usability
Version First Reported In: 6.7.0   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 6.9
Sentry Crash Report:
Attachments: Screenshot

Description postix 2024-11-13 12:46:17 UTC
Created attachment 175778 [details]
Screenshot

STEPS TO REPRODUCE
1. Open Systemsettings
2. Open Sound KCM
3. Click on Rename Devices ...
4. Select some text of the info message
> Saving changes will restart audio services. Apps playing audio will experience interruptions and may need to be restarted.
5. Right click on the selected text to open the context menu
6. Move the cursor to Copy

OBSERVED RESULT
The text becomes un-selected and the copy option becomes disabled.

EXPECTED RESULT
The text does not loose it's selection. If nothing is selected it should offer to copy everything instead of being disabled.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20241111
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Graphics Platform: Wayland
Comment 1 Nate Graham 2024-11-13 16:15:39 UTC
Hah! Can reproduce.
Comment 2 Akseli Lahtinen 2024-11-25 17:08:09 UTC
Git commit 83109877404e18fc11d2983e7d585077e67af4e1 by Akseli Lahtinen.
Committed on 25/11/2024 at 17:08.
Pushed by akselmo into branch 'master'.

SelectableLabel: Make selection persistent

Without persistentSelection: contextMenu.visible the selection will be cleared
when context menu is opened and mouse is moved there, causing
user to be unable to copy the text.

This is needed to have the expected behavior.

M  +1    -0    src/controls/SelectableLabel.qml

https://invent.kde.org/frameworks/kirigami/-/commit/83109877404e18fc11d2983e7d585077e67af4e1
Comment 3 Nate Graham 2024-11-25 20:59:22 UTC
*** Bug 496567 has been marked as a duplicate of this bug. ***