From 88fb3428872a332c750187e15cdc58397231f396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CA=88=E1=B5=83=E1=B5=A2?= Date: Thu, 7 Dec 2023 13:33:49 -0800 Subject: [PATCH] fix(dashboard): use textContent to render hidden title (#26189) --- .../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, - ' ', - ); + sizerRef.current.textContent = currentTitle || placeholder; } }, [currentTitle, placeholder, sizerRef]);