[bugfix] Picker: fix the error at low version of the Android. See #3538 (#3688)

This commit is contained in:
流采 2019-06-29 08:36:35 +08:00 committed by neverland
parent fe87885d90
commit 0a79536a05
2 changed files with 4 additions and 2 deletions

View File

@ -16,7 +16,8 @@ const MOMENTUM_LIMIT_DISTANCE = 15;
const [createComponent, bem] = createNamespace('picker-column'); const [createComponent, bem] = createNamespace('picker-column');
function getElementTranslateY(element) { function getElementTranslateY(element) {
const { transform } = window.getComputedStyle(element); const style = window.getComputedStyle(element);
const transform = style.transform || style.webkitTransform;
const translateY = transform.slice(7, transform.length - 1).split(', ')[5]; const translateY = transform.slice(7, transform.length - 1).split(', ')[5];
return Number(translateY); return Number(translateY);
@ -228,7 +229,7 @@ export default createComponent({
const wrapperStyle = { const wrapperStyle = {
transform: `translate3d(0, ${this.offset + baseOffset}px, 0)`, transform: `translate3d(0, ${this.offset + baseOffset}px, 0)`,
transitionDuration: `${this.duration}ms`, transitionDuration: `${this.duration}ms`,
transitionProperty: this.duration ? 'transform' : 'none', transitionProperty: this.duration ? 'all' : 'none',
lineHeight: `${itemHeight}px` lineHeight: `${itemHeight}px`
}; };

View File

@ -71,6 +71,7 @@
linear-gradient(0deg, hsla(0, 0%, 100%, .9), hsla(0, 0%, 100%, .4)); linear-gradient(0deg, hsla(0, 0%, 100%, .9), hsla(0, 0%, 100%, .4));
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: top, bottom; background-position: top, bottom;
backface-visibility: hidden;
pointer-events: none; pointer-events: none;
} }