Use childNode.remove() instead of parentNode.removeChild() (S7762)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
75adbd9c6b
commit
4cd61aed0d
1 file changed
+1
-1
@@ -333,7 +333,7 @@ function getTextWidth(text, e) {
|
||||
hiddenSpan.style.visibility = "hidden";
|
||||
document.body.appendChild(hiddenSpan);
|
||||
const width = hiddenSpan.getBoundingClientRect().width;
|
||||
document.body.removeChild(hiddenSpan);
|
||||
hiddenSpan.remove();
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user