You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ta...@apache.org on 2023/12/07 21:33:58 UTC

(superset) branch master updated: fix(dashboard): use textContent to render hidden title (#26189)

This is an automated email from the ASF dual-hosted git repository.

tai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 88fb342887 fix(dashboard): use textContent to render hidden title (#26189)
88fb342887 is described below

commit 88fb3428872a332c750187e15cdc58397231f396
Author: ʈᵃᵢ <td...@gmail.com>
AuthorDate: Thu Dec 7 13:33:49 2023 -0800

    fix(dashboard): use textContent to render hidden title (#26189)
---
 superset-frontend/src/components/DynamicEditableTitle/index.tsx | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/superset-frontend/src/components/DynamicEditableTitle/index.tsx b/superset-frontend/src/components/DynamicEditableTitle/index.tsx
index 86205bebc2..670962de5f 100644
--- a/superset-frontend/src/components/DynamicEditableTitle/index.tsx
+++ b/superset-frontend/src/components/DynamicEditableTitle/index.tsx
@@ -113,10 +113,7 @@ export const DynamicEditableTitle = ({
   // then we can measure the width of that span to resize the input element
   useLayoutEffect(() => {
     if (sizerRef?.current) {
-      sizerRef.current.innerHTML = (currentTitle || placeholder).replace(
-        /\s/g,
-        '&nbsp;',
-      );
+      sizerRef.current.textContent = currentTitle || placeholder;
     }
   }, [currentTitle, placeholder, sizerRef]);