aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Agosti <francesco.agosti93@gmail.com>2018-11-29 09:06:33 +0800
committerGitHub <noreply@github.com>2018-11-29 09:06:33 +0800
commit906bba7d751397afd507abf68fb7e0fb8ec7e31c (patch)
treed4f39f7ff8ed93cd1e5977547bed39b28e37ddd5
parent1eb19ca1ec98974be36c500f872cffe0be977e58 (diff)
parent85d1dba1ef5ba4d34de46cb7eb54bfdc7acae380 (diff)
downloaddexon-0x-contracts-906bba7d751397afd507abf68fb7e0fb8ec7e31c.tar.gz
dexon-0x-contracts-906bba7d751397afd507abf68fb7e0fb8ec7e31c.tar.zst
dexon-0x-contracts-906bba7d751397afd507abf68fb7e0fb8ec7e31c.zip
Merge pull request #1352 from 0xProject/fix/instant/token-symbol-size
[instant] Notify of the used font size for re-renders of scaling input
-rw-r--r--packages/instant/src/components/scaling_input.tsx6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/instant/src/components/scaling_input.tsx b/packages/instant/src/components/scaling_input.tsx
index 129162a74..791692257 100644
--- a/packages/instant/src/components/scaling_input.tsx
+++ b/packages/instant/src/components/scaling_input.tsx
@@ -98,6 +98,12 @@ export class ScalingInput extends React.Component<ScalingInputProps, ScalingInpu
inputWidthPx: this._getInputWidthInPx(),
};
}
+ public componentDidMount(): void {
+ // Trigger an initial notification of the calculated fontSize.
+ const currentPhase = ScalingInput.getPhaseFromProps(this.props);
+ const currentFontSize = ScalingInput.calculateFontSizeFromProps(this.props, currentPhase);
+ this.props.onFontSizeChange(currentFontSize);
+ }
public componentDidUpdate(
prevProps: ScalingInputProps,
prevState: ScalingInputState,