I had the same problem.
My "Fix" is this function:
@
function checkForAnchor(scrollObject,webOject,url){
var a = new String(url);
if (a.split("#").length > 1){
var textPosition = webOject.evaluateJavaScript("document.getElementById('"+a.split("#")[1]+"').getClientRects()");
if (textPosition == 'undefined'){
evaluateJavaScript('function getElementsByAttribute(oElm, strTagName, strAttributeName, strAttributeValue){
var arrElements = (strTagName == "" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
var arrReturnElements = new Array();
var oAttributeValue = (typeof strAttributeValue != "undefined")? new RegExp("(^|\s)" + strAttributeValue + "(\s|$)", "i") : null;
var oCurrent;
var oAttribute;
for(var i=0; i<arrElements.length; i++){
oCurrent = arrElements[i];
oAttribute = oCurrent.getAttribute && oCurrent.getAttribute(strAttributeName);
if(typeof oAttribute == "string" && oAttribute.length > 0){
if(typeof strAttributeValue == "undefined" || (oAttributeValue && oAttributeValue.test(oAttribute))){
arrReturnElements.push(oCurrent);
}
}
}
return arrReturnElements;
}')
textPosition = webOject.evaluateJavaScript('getElementsByAttribute(document,"", "title", "'+a.split("#")[1]+'")[0].getClientRects()')
}
if (textPosition != undefined){
scrollObject.contentY = textPosition[0]["top"];
}
}
}
@
After this, on webView call:
@ onLoadFinished: {
checkForAnchor(flickable,pageViewer,url);
}
@
I know is a old post, but maybe will help someone in the future.
Happy Qt-ing