Open sp-kilobug opened 7 years ago
There is a "not so uncommon" bug case causing iscroll v5.2.0-snapshot to freeze. According to _move(), after 300ms, this.startTime is reseted to current timestamp https://github.com/cubiq/iscroll/blob/master/build/iscroll.js#L606 If you release the pointer at this moment, the _end function is called with a duration = utils.getTime() - this.startTime = 0 As a side effect, if this.y == this.startY when releasing the mouse button, we have a 0/0 = NaN in utils.momentum https://github.com/cubiq/iscroll/blob/master/build/iscroll.js#L58 causing newY = momentumY.destination = NaN https://github.com/cubiq/iscroll/blob/master/build/iscroll.js#L671 After that, properties are corrupted with NaN values causing iscroll to freeze.
I'm currently testing this fix at l.607 : this.startTime = timestamp - 1;
There is a "not so uncommon" bug case causing iscroll v5.2.0-snapshot to freeze. According to _move(), after 300ms, this.startTime is reseted to current timestamp https://github.com/cubiq/iscroll/blob/master/build/iscroll.js#L606 If you release the pointer at this moment, the _end function is called with a
duration = utils.getTime() - this.startTime = 0 As a side effect, if this.y == this.startY when releasing the mouse button, we have a 0/0 = NaN in utils.momentum https://github.com/cubiq/iscroll/blob/master/build/iscroll.js#L58 causing newY = momentumY.destination = NaN https://github.com/cubiq/iscroll/blob/master/build/iscroll.js#L671 After that, properties are corrupted with NaN values causing iscroll to freeze.
I'm currently testing this fix at l.607 : this.startTime = timestamp - 1;