提交 2815e732 编写于 作者: M Matt Bierner

Fix refocusing clearing existing forcus for iframe based webviews

#83188
上级 4247b296
......@@ -439,10 +439,18 @@
// propagate focus
host.onMessage('focus', () => {
const target = getActiveFrame();
if (target) {
target.contentWindow.focus();
const activeFrame = getActiveFrame();
if (!activeFrame || !activeFrame.contentWindow) {
return;
}
if (document.activeElement === activeFrame) {
// We are already focused on the iframe (or one of its children) so no need
// to refocus.
return;
}
activeFrame.contentWindow.focus();
});
// update iframe-contents
......@@ -573,6 +581,8 @@
newFrame.contentWindow.focus();
}
contentWindow.addEventListener('scroll', handleInnerScroll);
contentWindow.addEventListener('wheel', handleWheel);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册