FormattedValueDisplay: Improve styles check (#95639)

This commit is contained in:
Alex Khomenko
2024-10-31 12:59:46 +02:00
committed by GitHub
parent bf6056f2fa
commit f7e9aeac6e
@@ -23,7 +23,7 @@ export const FormattedValueDisplay = ({ value, className, style, ...htmlProps }:
const hasSuffix = (value.suffix ?? '').length > 0;
let suffixStyle;
if (style && style.fontSize && typeof style.fontSize === 'number') {
if (style && typeof style.fontSize === 'number' && !Number.isNaN(style.fontSize)) {
const fontSize = style.fontSize;
const reductionFactor = fontSizeReductionFactor(fontSize);
suffixStyle = { fontSize: fontSize * reductionFactor };