mirror of https://github.com/apache/superset.git
fix(dashboard): use textContent to render hidden title (#26189)
This commit is contained in:
parent
b4a35e624b
commit
88fb342887
|
@ -113,10 +113,7 @@ export const DynamicEditableTitle = ({
|
||||||
// then we can measure the width of that span to resize the input element
|
// then we can measure the width of that span to resize the input element
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (sizerRef?.current) {
|
if (sizerRef?.current) {
|
||||||
sizerRef.current.innerHTML = (currentTitle || placeholder).replace(
|
sizerRef.current.textContent = currentTitle || placeholder;
|
||||||
/\s/g,
|
|
||||||
' ',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}, [currentTitle, placeholder, sizerRef]);
|
}, [currentTitle, placeholder, sizerRef]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue