Check before calling blur on activeElement.
It's possible for slides to be in a situation where the last clicked thing was an SVG before the tab/window loses focus. When returning, `.blur()` is called on the previously-active element, but can result in an exception. This protects against that and will only call `.blur()` when `document.activeElement` supports it.
This commit is contained in:
parent
ce8ea84393
commit
76c5726c04
|
@ -3872,7 +3872,10 @@
|
||||||
// If, after clicking a link or similar and we're coming back,
|
// If, after clicking a link or similar and we're coming back,
|
||||||
// focus the document.body to ensure we can use keyboard shortcuts
|
// focus the document.body to ensure we can use keyboard shortcuts
|
||||||
if( isHidden === false && document.activeElement !== document.body ) {
|
if( isHidden === false && document.activeElement !== document.body ) {
|
||||||
|
// Not all elements support .blur() - SVGs among them.
|
||||||
|
if (typeof document.activeElement.blur === 'function') {
|
||||||
document.activeElement.blur();
|
document.activeElement.blur();
|
||||||
|
}
|
||||||
document.body.focus();
|
document.body.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue