Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Allows the use of tag elements during script tag trigger events #914

Merged
merged 4 commits into from
Sep 9, 2020
Merged

🐛 Allows the use of tag elements during script tag trigger events #914

merged 4 commits into from
Sep 9, 2020

Conversation

wangzongxu
Copy link
Contributor

Checklist
  • npm test passes
  • tests are included
  • documentation is changed or added
  • commit message follows commit guidelines
Description of change

当我们在接入qiankun的时候,
发现其中的一个子项目有报错,
跟踪堆栈发现,是因为那个子项目中对于script标签都进行了onload事件监听,
并且使用了事件对象的target属性来获取src。

下面是伪代码:

srcipt.onload = function(e) {
  console.log(e.target.src)
}

由于qiankun派发的自定义事件中没有定义target,
所以报错了,
这个PR中的getPatchedCustomEvent方法为以后可能需要添加更多属性提供了准备。

Copy link
Member

@kuitos kuitos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your nice work!

src/sandbox/patchers/dynamicAppend.ts Outdated Show resolved Hide resolved
src/sandbox/patchers/dynamicAppend.ts Outdated Show resolved Hide resolved
kuitos
kuitos previously approved these changes Sep 9, 2020
src/sandbox/patchers/dynamicAppend.ts Outdated Show resolved Hide resolved
src/sandbox/patchers/dynamicAppend.ts Outdated Show resolved Hide resolved
src/sandbox/patchers/dynamicAppend.ts Outdated Show resolved Hide resolved
@kuitos kuitos merged commit 2c984ce into umijs:master Sep 9, 2020
kuitos added a commit that referenced this pull request May 29, 2022
)

Co-authored-by: wangzongxu <wangzongxu@vipkid.com.cn>
Co-authored-by: Kuitos <kuitos.lau@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants