mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] Stepper: Hack for iOS12 page scroll (#3804)
This commit is contained in:
parent
7caf664e48
commit
577194b16d
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user