diff --git a/superset-frontend/src/components/DynamicEditableTitle/index.tsx b/superset-frontend/src/components/DynamicEditableTitle/index.tsx index 86205bebc267e..670962de5fb5c 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]);