Skip to content

Commit

Permalink
Merge pull request #19653 from dukenv0307/fix/19387
Browse files Browse the repository at this point in the history
fix: update height for text container
  • Loading branch information
amyevans authored May 30, 2023
2 parents 70e5aeb + a4f6f2a commit a98f3bc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/MagicCodeInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {StyleSheet, View} from 'react-native';
import PropTypes from 'prop-types';
import _ from 'underscore';
import styles from '../styles/styles';
import * as StyleUtils from '../styles/StyleUtils';
import * as ValidationUtils from '../libs/ValidationUtils';
import CONST from '../CONST';
import Text from './Text';
Expand Down Expand Up @@ -293,7 +294,14 @@ function MagicCodeInput(props) {
key={index}
style={[styles.w15]}
>
<View style={[styles.textInputContainer, focusedIndex === index ? styles.borderColorFocus : {}, props.hasError || props.errorText ? styles.borderColorDanger : {}]}>
<View
style={[
styles.textInputContainer,
StyleUtils.getHeightOfMagicCodeInput(),
focusedIndex === index ? styles.borderColorFocus : {},
props.hasError || props.errorText ? styles.borderColorDanger : {},
]}
>
<Text style={[styles.magicCodeInput, styles.textAlignCenter]}>{decomposeString(props.value, props.maxLength)[index] || ''}</Text>
</View>
<View style={[StyleSheet.absoluteFillObject, styles.w100, isMobileSafari ? styles.bgTransparent : styles.opacity0]}>
Expand Down
10 changes: 10 additions & 0 deletions src/styles/StyleUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ function getAvatarSize(size) {
return avatarSizes[size];
}

/**
* Return the height of magic code input container
*
* @returns {Object}
*/
function getHeightOfMagicCodeInput() {
return {height: styles.magicCodeInputContainer.minHeight - styles.textInputContainer.borderBottomWidth};
}

/**
* Return the style from an empty avatar size constant
*
Expand Down Expand Up @@ -1203,4 +1212,5 @@ export {
getGoogleListViewStyle,
getMentionStyle,
getMentionTextColor,
getHeightOfMagicCodeInput,
};

0 comments on commit a98f3bc

Please sign in to comment.