Element: [Bug Report]InfiniteScroll 按照官方组件案例使用 均报错异常

Created on 11 Jun 2019  ·  5Comments  ·  Source: ElemeFE/element

Element UI version

2.9.1

OS/Browsers version

Google Chrome 75.0.3770.80

Vue version

2.6.10

Reproduction Link

https://codepen.io/pen/?&editable=true

Steps to reproduce

InfiniteScroll 按照官方组件案例使用 均报错异常:Error in directive infinite-scroll inserted hook: "TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'."

并且官方在线代码在线运行也均有问题,无法使用。

What is Expected?

直接正常使用

What is actually happening?

直接正常使用

Most helpful comment

我的项目用的TS, 升级到2.9.1 直接引入在 element-ui.d.ts 这个组件的 pluginObject报错了...

All 5 comments

Translation of this issue:

Element UI version

2.9.1

OS/Browsers version

Google Chrome 75.0.3770.80

Vue version

2.6.10

Reproduction Link

Https://codepen.io/pen/?&editable=true

Steps to reproduce

InfiniteScroll uses all error-reporting exceptions according to official component cases: Error in directive infinite-scroll insert hook: "TypeError: Failed to execute'observe'on'Mutation Observer': parameter 1 is not of type'Node'."

And the official online code online operation is also problematic, can not be used.

What is Expected?

Direct normal use

What is actually happening?

Direct normal use

我的项目用的TS, 升级到2.9.1 直接引入在 element-ui.d.ts 这个组件的 pluginObject报错了...

这么严重的bug为啥到现在还修复?

export const isScroll = (el, vertical) => {
if (isServer) return;

const determinedDirection = vertical !== null || vertical !== undefined;
const overflow = determinedDirection
? vertical
? getStyle(el, 'overflow-y')
: getStyle(el, 'overflow-x')
: getStyle(el, 'overflow');

return overflow.match(/(scroll|auto)/);
};

export const getScrollContainer = (el, vertical) => {
if (isServer) return;

let parent = el;
while (parent) {
if ([window, document, document.documentElement].includes(parent)) {
return window;
}
if (isScroll(parent, vertical)) {
return parent;
}
parent = parent.parentNode;
}

return parent;
};

查看了一下源码,
需要给元素添加overflow,可以修复;
官方可以考虑如何规避一下这个问题;

需要给元素添加overflow 已补充文档

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mochenxm picture mochenxm  ·  3Comments

gengxuelei picture gengxuelei  ·  3Comments

sudo-suhas picture sudo-suhas  ·  3Comments

akaylh picture akaylh  ·  3Comments

yuchonghua picture yuchonghua  ·  3Comments