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

fix: Silence Closure errors when modifying tooltips. #6098

Merged
merged 1 commit into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/block_svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class BlockSvg extends Block {
svgMath.is3dSupported() && !!workspace.getBlockDragSurface();

const svgPath = this.pathObject.svgPath;
svgPath.tooltip = this;
(/** @type {?} */ (svgPath)).tooltip = this;
Tooltip.bindMouseEvents(svgPath);

// Expose this block's ID on its top-level SVG group.
Expand Down
2 changes: 1 addition & 1 deletion core/field.js
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ class Field {
}
const clickTarget = this.getClickTarget_();
if (clickTarget) {
clickTarget.tooltip = newTip;
(/** @type {?} */ (clickTarget)).tooltip = newTip;
} else {
// Field has not been initialized yet.
this.tooltip_ = newTip;
Expand Down
2 changes: 1 addition & 1 deletion core/flyout_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ class Flyout extends DeleteArea {
'width': blockHW.width,
},
null);
rect.tooltip = block;
(/** @type {?} */ (rect)).tooltip = block;
Tooltip.bindMouseEvents(rect);
// Add the rectangles under the blocks, so that the blocks' tooltips work.
this.workspace_.getCanvas().insertBefore(rect, block.getSvgRoot());
Expand Down
2 changes: 1 addition & 1 deletion core/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ const onMouseOut = function(_e) {
* @param {!Event} e Mouse event.
*/
const onMouseMove = function(e) {
if (!element || !element.tooltip) {
if (!element || !(/** @type {?} */ (element)).tooltip) {
// No tooltip here to show.
return;
} else if (blocked) {
Expand Down