Bug 424076 - PlasmaComponents3.ComboBox closes popup on click release when editable=true
Summary: PlasmaComponents3.ComboBox closes popup on click release when editable=true
Alias: None
Product: frameworks-plasma
Classification: Frameworks and Libraries
Component: components (show other bugs)
Version: 5.71.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Chris Holland
Depends on:
Reported: 2020-07-10 18:49 UTC by Chris Holland
Modified: 2020-10-09 16:43 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.76


Note You need to log in before you can comment on or make changes to this bug.
Description Chris Holland 2020-07-10 18:49:36 UTC

One solution is to make `contentItem: T.TextField {}` instead of `MouseArea` wrapping the `TextField`. However this breaks press+drag+select.

Note that if you do press+drag, it spams this:
file:///usr/lib/qt/qml/org/kde/plasma/components.3/ComboBox.qml:112: ReferenceError: controlRoot is not defined

IF we make contentItem: T.TextField, it would also fix another bug: PlasmaComponents3.ComboBox autocomplete doesn't work.

See `QQuickComboBoxPrivate::updateEditText()` to where it casts `contentItem` as `QQuickTextInput`.


I've personally patched the ComboBox with:

OS: Manjaro
KDE Plasma Version: 5.19.80 (plasma-git)
KDE Frameworks Version: 5.71 (kf5-git)
Qt Version: 5.15
Comment 1 Nate Graham 2020-07-12 14:34:17 UTC
Can you please submit your patch upstream? Thanks!
Comment 2 Bug Janitor Service 2020-07-14 17:06:18 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/plasma-framework/-/merge_requests/36
Comment 3 Bug Janitor Service 2020-08-16 01:43:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/qqc2-desktop-style/-/merge_requests/19
Comment 4 Chris Holland 2020-10-08 13:39:24 UTC
Git commit 086a710478592bc4c93b90c28d4ec88e8ae8b86f by Zren (Chris Holland), on behalf of Chris Holland.
Committed on 08/10/2020 at 13:34.
Pushed by cholland into branch 'master'.

ComboBox3.contentItem must be a QQuickTextInput to fix autocomplete

See QQuickComboBoxPrivate::updateEditText()

By removing the MouseArea previously in the contentItem, we lose the
ability to press+hold+drag to select a drop down item.

The wheel events still work, as they are captured by the MouseArea in
the background component.

The combobox previously closed the popup when releasing the click to
open the dropdown when editable=true.

M  +45   -103  src/declarativeimports/plasmacomponents3/ComboBox.qml