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/instant | |
parent | 1eb19ca1ec98974be36c500f872cffe0be977e58 (diff) | |
parent | 85d1dba1ef5ba4d34de46cb7eb54bfdc7acae380 (diff) | |
download | dexon-sol-tools-906bba7d751397afd507abf68fb7e0fb8ec7e31c.tar dexon-sol-tools-906bba7d751397afd507abf68fb7e0fb8ec7e31c.tar.gz dexon-sol-tools-906bba7d751397afd507abf68fb7e0fb8ec7e31c.tar.bz2 dexon-sol-tools-906bba7d751397afd507abf68fb7e0fb8ec7e31c.tar.lz dexon-sol-tools-906bba7d751397afd507abf68fb7e0fb8ec7e31c.tar.xz dexon-sol-tools-906bba7d751397afd507abf68fb7e0fb8ec7e31c.tar.zst dexon-sol-tools-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/instant')
-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, |