Skip to content

Menu: fix TextFieldContextMenu opening at wrong position

Fushan Wen requested to merge work/fuf/evilbug into master

QQuickMenu places the menu based on the size of its parent and its size, but when all menu items are invisible, the ListView in Menu.qml calculates its contentHeight based on an assumed average size (100), which causes the menu height to become excessively huge when there are many invisible menu items, so when repositioning the menu will be placed at a wrong position.

This uses childrenRect to only include visible items.

BUG: 481293 FIXED-IN: 6.0

Before After
image image

Merge request reports