vux scroller on iOS13, a jump to the top of the slide stop

Today the problem customer feedback, said in the latest version of iOS (iOS13), slide list, will jump to the top of the slip finish, and then went to check the document under vux, there is no solution, Baidu a lot, there is no relevant problem, which in the end can only look at the source code in addition to the problem.

Through the search layers, and finally found ios13 above results acquired with the old version of the transform result is not the same

// the old version: 
'Matrix (. 1, -2.4492935982947064, 2.4492935982947064,. 1, 0, 19.48200035095215)' // new version 
'matrix (1, -2.4492935982947064e-16 , 2.4492935982947064e-16, 1, 0, 19.48200035095215)'
 

 

The vux-xscroll regular is so written  

window.getComputedStyle(this.container)[transform].match(/[-\d\.*\d*]+/g)

Accompanied with the latest version of ios appears [ "1", "-2.4492935982947064", "-16", "2.4492935982947064", "-16", "1", "0", "19.48200035095215"]

Then the program will lead to confusion.

Specific code directory checksum method is getScrollTop \ node_modules \ _vux-xscroll \ \ cmd under @ 3.1.12 @ vux-xscroll build \ simulate-scroll.js of

Workaround: \ node_modules \ _vux-xscroll @ 3.1.12 @ vux-xscroll \ build \ cmd \ getScrollTop method under simulate-scroll.js inside the regular expression replaced with the following on it.

  getScrollTop: function() {
    // var transY = window.getComputedStyle(this.container)[transform].match(/[-\d\.*\d*]+/g);
    var transY = window.getComputedStyle(this.container)[transform].match(/[-\d\.*\d*e\-\d]+/g);
    return transY ? Math.round(transY[5]) === 0 ? 0 : -Math.round(transY[5]) : 0;
  },

If there is any good solution, bloggers can tell Oh.

 

Guess you like

Origin www.cnblogs.com/darkbluelove/p/11655854.html