ant-design: TypeError: "parameter 1 is not of type "Element"." on Firefox.
- I have searched the issues of this repository and believe that this is not a duplicate.
Reproduction link
https://testbdweb.educoder.net/ec_courses/148/ec_course_support_setting
Steps to reproduce
I am using this code in a dynamic form. And I got the error on firefox when the form init. The code works fine on Chrome. Any ideas? Thanks.
{getFieldDecorator(`target_contents[${k}]`, {
// validateTrigger: ['onChange', 'onBlur'],
rules: [{
required: true,
// whitespace: true,
message: "请填入目标内容",
}],
})(
<TextArea autosize placeholder="" style={{ width: '100%', marginRight: 8 }} />
)}
/**
* Starts observing provided element.
*
* @param {Element} target - Element to be observed.
* @returns {void}
*/
ResizeObserverSPI.prototype.observe = function (target) {
if (!arguments.length) {
throw new TypeError('1 argument required, but only 0 present.');
}
// Do nothing if current environment doesn't have the Element interface.
if (typeof Element === 'undefined' || !(Element instanceof Object)) {
return;
}
if (!(target instanceof getWindowOf(target).Element)) {
throw new TypeError('parameter 1 is not of type "Element".');
}
What is expected?
no error.
What is actually happening?
got error: TypeError: “parameter 1 is not of type “Element”.”
observe ResizeObserver.es.js:778 e ResizeObserver.es.js:916 value TextArea.js:148 value TextArea.js:122 br react-dom.production.min.js:229 gr react-dom.production.min.js:220 vr react-dom.production.min.js:219 pr react-dom.production.min.js:216 ir react-dom.production.min.js:214
Environment | Info |
---|---|
antd | 3.11.6 |
React | 16.3.0-alpha.2 |
System | windows10 |
Browser | firefox 65.0.1 |
website id and password : kosasa33! open the website and click edit button.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (8 by maintainers)
不好意思,是我们自己的问题。 应该基本确定问题了,是有全局加载的js覆盖掉了Window.Element,会导致这个判断通不过:
if (!(target instanceof getWindowOf(target).Element)) {
https://github.com/souporserious/react-measure/issues/76#issuecomment-358448544 https://github.com/deepsweet/hocs/issues/15
something related from google.