[bugfix] Stepper: Hack for iOS12 page scroll (#3804)

This commit is contained in:
drafish 2019-07-10 16:26:51 +08:00 committed by neverland
parent 7caf664e48
commit 577194b16d

View File

@ -1,4 +1,6 @@
import { createNamespace, isDef, addUnit } from '../utils';
import { getRootScrollTop } from '../utils/dom/scroll';
import { isIOS } from '../utils/validate/system';
const [createComponent, bem] = createNamespace('stepper');
@ -153,6 +155,13 @@ export default createComponent({
if (this.currentValue === 0) {
event.target.value = this.currentValue;
}
// Hack for iOS12 page scroll
// https://developers.weixin.qq.com/community/develop/doc/00044ae90742f8c82fb78fcae56800
/* istanbul ignore next */
if (isIOS()) {
window.scrollTo(0, getRootScrollTop());
}
},
longPressStep() {