fix: type error in uneditable bubbles (#6092)

This commit is contained in:
Rachel Fenichel
2022-04-20 11:20:12 -07:00
committed by GitHub
parent f30a64c1bf
commit 7353c61b2b
2 changed files with 11 additions and 5 deletions

View File

@@ -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;
}
}

View File

@@ -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);
}