mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Make sure el can be blurred before doing so (#4506)
This commit is contained in:
committed by
GitHub
parent
b21fa5de63
commit
2de6c9ec7a
@@ -1814,7 +1814,10 @@ Blockly.WorkspaceSvg.prototype.markFocused = function() {
|
||||
Blockly.WorkspaceSvg.prototype.setBrowserFocus = function() {
|
||||
// Blur whatever was focused since explicitly grabbing focus below does not
|
||||
// work in Edge.
|
||||
if (document.activeElement) {
|
||||
// In IE, SVGs can't be blurred or focused. Check to make sure the current
|
||||
// focus can be blurred before doing so.
|
||||
// See https://github.com/google/blockly/issues/4440
|
||||
if (document.activeElement && document.activeElement.blur) {
|
||||
document.activeElement.blur();
|
||||
}
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user