From 7353c61b2b7ee3b5e6b60b061e1414f29f01f596 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Wed, 20 Apr 2022 11:20:12 -0700 Subject: [PATCH] fix: type error in uneditable bubbles (#6092) --- core/browser_events.js | 12 ++++++++---- core/bubble.js | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/browser_events.js b/core/browser_events.js index aac2066d3..4e689f9e2 100644 --- a/core/browser_events.js +++ b/core/browser_events.js @@ -219,10 +219,14 @@ const isTargetInput = function(e) { if (e.target instanceof HTMLInputElement) { const target = e.target; - return target.type === 'textarea' || target.type === 'text' || - target.type === 'number' || target.type === 'email' || - target.type === 'password' || target.type === 'search' || - target.type === 'tel' || target.type === 'url'; + return target.type === 'text' || target.type === 'number' || + target.type === 'email' || target.type === 'password' || + target.type === 'search' || target.type === 'tel' || + target.type === 'url'; + } + + if (e.target instanceof HTMLTextAreaElement) { + return true; } } diff --git a/core/bubble.js b/core/bubble.js index d2a332788..c4aff80dc 100644 --- a/core/bubble.js +++ b/core/bubble.js @@ -931,7 +931,9 @@ const Bubble = class { // This cannot be done until the bubble is rendered on screen. const maxWidth = paragraphElement.getBBox().width; for (let i = 0, textElement; - (textElement = paragraphElement.childNodes[i]); i++) { + (textElement = /** @type {!SVGTSpanElement} */ ( + paragraphElement.childNodes[i])); + i++) { textElement.setAttribute('text-anchor', 'end'); textElement.setAttribute('x', maxWidth + Bubble.BORDER_WIDTH); }