[bugfix] Field: add hack for iOS 12 scroll position (#3204)

This commit is contained in:
neverland
2019-04-23 19:32:33 +08:00
committed by GitHub
parent 5f2b027070
commit 2190b34028
2 changed files with 9 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
import { use, isObj, isDef } from '../utils';
import { use, isObj, isDef, isIOS } from '../utils';
import Icon from '../icon';
import Cell from '../cell';
import { cellProps } from '../cell/shared';
@@ -102,6 +102,13 @@ export default sfc({
onBlur(event) {
this.focused = false;
this.$emit('blur', event);
// Hack for iOS12 page scroll
// https://developers.weixin.qq.com/community/develop/doc/00044ae90742f8c82fb78fcae56800
/* istanbul ignore next */
if (isIOS()) {
window.scrollTo(0, window.pageYOffset);
}
},
onClickLeftIcon() {