aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/scaling_input.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-12-01 03:58:05 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-12-01 03:58:05 +0800
commitea11e8c62dac9ff6352bc983efc707d855b8e881 (patch)
treecdfc9ad01c2a4e56c560809cb7e01895987ef442 /packages/instant/src/components/scaling_input.tsx
parent7479a7db58f5504416a88450c92b092899bf3df3 (diff)
parenta1d4aa66bc6b3de041ec6e4eb4fe40383945510b (diff)
downloaddexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar
dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.gz
dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.bz2
dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.lz
dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.xz
dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.tar.zst
dexon-sol-tools-ea11e8c62dac9ff6352bc983efc707d855b8e881.zip
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into fix/instant/instant-bounces-on-error
Diffstat (limited to 'packages/instant/src/components/scaling_input.tsx')
-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,