ant-design / ant-design-icons

⭐ Ant Design SVG Icons
https://ant.design/components/icon/
MIT License
960 stars 582 forks source link

fix: node.insertBefore parameter issue #540

Closed gaokun closed 12 months ago

gaokun commented 2 years ago

Root Cause

According to insertBefore API doc:

Note: referenceNode is not an optional parameter. You must explicitly pass a Node or null.

so we have to pass null, if referenceNode is undefined for 2nd parameter.

References:

1. insertBefore equals appendChild when referenceNode is null, refer to Vue source code

image

2. In Chrome, Firefox, Safari, it works when referenceNode is undefined, the same as null dose.

But happy-dom doesn't, it is strict as API said. check this code

image

3. An issue in ant-design-vue was caused by this.