SilicaListView + positionViewAtIndex from ContextMenu buggy behaviour

REPRODUCIBILITY (% or how often): 50-75%
BUILD ID:
HARDWARE (Jolla1, Tablet, XA2,…): jollaC, SDK emulator
UI LANGUAGE: QML
REGRESSION: (compared to previous public release: Yes, No, ?): ?

DESCRIPTION:

Weird behaviour of positionViewAtIndex when called from a ContextMenu. Beginning to think this is another item where menu animation is interfering with the action, but unlike with pushupmenu there is no way to cancel the contextmenu animation. Long story short if you try to call positionViewAtIndex from contextmenu it works like 50% of the time, sometimes it will reposition correctly, sometimes you just get a short twitch and the view moves just a tiny little bit (sometimes it looks like it ends exactly where the extended menu would have ended, other times even less, seems to work more reliably when the index to which you want to scroll is not in any part on the screen). Don’t think this is any other bad code from the rest of the app interfering as can reproduce with this example code in the emulator:

PRECONDITIONS:

import QtQuick 2.0
import Sailfish.Silica 1.0

Page {
SilicaListView {
    id: list
    anchors.fill: parent

    model: ListModel {
        id: listModel
        Component.onCompleted: {
            for (var i=0; i<25; i++) {
                append({"name": "Item " + i})
            }
        }
    }

    delegate: ListItem {
        width: ListView.view.width

        Label {
            id: label
            text: model.name
            anchors.centerIn: parent
        }

        menu: ContextMenu {
            MenuItem {
                text: "scroll to 1"
                onClicked: list.positionViewAtIndex(0, ListView.Beginning)
            }
            MenuItem {
                text: "scroll to 8"
                onClicked: list.positionViewAtIndex(7, ListView.Beginning)
            }
        }
    }
}
}

STEPS TO REPRODUCE:

  1. Compile code from PRECONDITIONS in emulator, scroll the page down a bit so option 0 and 7 are off the screen
  2. ContextMenu option ‘Scroll to 1’ will work 90% of the time (sometimes will scroll to option 2 or 3 instead, sometimes 5)
  3. ContextMenu option ‘Scroll to 8’ works around 50% of the time (results are all over the place and depends on how much down the list you scroll and item on which you opened the menu)

EXPECTED RESULT:

You get scroll to the correct position every time

ACTUAL RESULT:

All over the place

ADDITIONAL INFORMATION:

(Please ALWAYS attach relevant data such as logs, screenshots, etc…)