diff options
author | Francesco Agosti <francesco.agosti93@gmail.com> | 2018-11-29 09:06:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-29 09:06:33 +0800 |
commit | 906bba7d751397afd507abf68fb7e0fb8ec7e31c (patch) | |
tree | d4f39f7ff8ed93cd1e5977547bed39b28e37ddd5 /packages | |
parent | 1eb19ca1ec98974be36c500f872cffe0be977e58 (diff) | |
parent | 85d1dba1ef5ba4d34de46cb7eb54bfdc7acae380 (diff) | |
download | dexon-0x-contracts-906bba7d751397afd507abf68fb7e0fb8ec7e31c.tar dexon-0x-contracts-906bba7d751397afd507abf68fb7e0fb8ec7e31c.tar.gz dexon-0x-contracts-906bba7d751397afd507abf68fb7e0fb8ec7e31c.tar.bz2 dexon-0x-contracts-906bba7d751397afd507abf68fb7e0fb8ec7e31c.tar.lz dexon-0x-contracts-906bba7d751397afd507abf68fb7e0fb8ec7e31c.tar.xz 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
Diffstat (limited to 'packages')
-rw-r--r-- | packages/instant/src/components/scaling_input.tsx | 6 |
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, |