Skip to content

Commit

Permalink
Merge pull request #33233 from FitseTLT/fix-error-message-overlap-on-…
Browse files Browse the repository at this point in the history
…zoom

Fix error message overlap on zoom
  • Loading branch information
flodnv authored Dec 19, 2023
2 parents aa1d87c + 661f783 commit b3ecf32
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/iou/steps/MoneyRequestAmountForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCu
<View
id={AMOUNT_VIEW_ID}
onMouseDown={(event) => onMouseDown(event, [AMOUNT_VIEW_ID])}
style={[styles.flex1, styles.flexRow, styles.w100, styles.alignItemsCenter, styles.justifyContentCenter]}
style={[styles.moneyRequestAmountContainer, styles.flex1, styles.flexRow, styles.w100, styles.alignItemsCenter, styles.justifyContentCenter]}
>
<TextInputWithCurrencySymbol
formattedAmount={formattedAmount}
Expand Down
2 changes: 2 additions & 0 deletions src/styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2691,6 +2691,8 @@ const styles = (theme: ThemeColors) =>
paddingVertical: 12,
},

moneyRequestAmountContainer: {minHeight: variables.inputHeight + 2 * (variables.formErrorLineHeight + 8)},

requestPreviewBox: {
marginTop: 12,
maxWidth: variables.reportPreviewMaxWidth,
Expand Down
2 changes: 1 addition & 1 deletion src/styles/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {PixelRatio} from 'react-native';
* method always returns the defaultValue (first param). When the device font size increases/decreases, the PixelRatio.getFontScale() value increases/decreases as well.
* This means that if you have text and its 'fontSize' is 19, the device font size changed to the 5th level on the iOS slider and the actual fontSize is 19 * PixelRatio.getFontScale()
* = 19 * 1.11 = 21.09. Since we are disallowing font scaling we need to calculate it manually. We calculate it with: PixelRatio.getFontScale() * defaultValue > maxValue ? maxValue :
* defaultValue * PixelRatio getFontScale() This means that the fontSize is increased/decreased when the device font size changes up to maxValue (second param)
* defaultValue * PixelRatio.getFontScale() This means that the fontSize is increased/decreased when the device font size changes up to maxValue (second param)
*/
function getValueUsingPixelRatio(defaultValue: number, maxValue: number): number {
return PixelRatio.getFontScale() * defaultValue > maxValue ? maxValue : defaultValue * PixelRatio.getFontScale();
Expand Down

0 comments on commit b3ecf32

Please sign in to comment.