mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
Merge pull request #2151 from mehdi-yeganeh/develop
#1848 Fixed throw console warning when deleting workspace comments
This commit is contained in:
@@ -425,6 +425,7 @@ Blockly.WorkspaceCommentSvg.prototype.disposeInternal_ = function() {
|
||||
this.foreignObject_ = null;
|
||||
this.svgRectTarget_ = null;
|
||||
this.svgHandleTarget_ = null;
|
||||
this.disposed_ = true;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -436,6 +437,9 @@ Blockly.WorkspaceCommentSvg.prototype.setFocus = function() {
|
||||
this.focused_ = true;
|
||||
// Defer CSS changes.
|
||||
setTimeout(function() {
|
||||
if (comment.disposed_) {
|
||||
return;
|
||||
}
|
||||
comment.textarea_.focus();
|
||||
comment.addFocus();
|
||||
Blockly.utils.addClass(
|
||||
@@ -454,6 +458,10 @@ Blockly.WorkspaceCommentSvg.prototype.blurFocus = function() {
|
||||
this.focused_ = false;
|
||||
// Defer CSS changes.
|
||||
setTimeout(function() {
|
||||
if (comment.disposed_) {
|
||||
return;
|
||||
}
|
||||
|
||||
comment.textarea_.blur();
|
||||
comment.removeFocus();
|
||||
Blockly.utils.removeClass(
|
||||
|
||||
Reference in New Issue
Block a user