diff --git a/src/components/TextInput/BaseTextInput.js b/src/components/TextInput/BaseTextInput.js index 9e9a6622357b..a8be3ecec95d 100644 --- a/src/components/TextInput/BaseTextInput.js +++ b/src/components/TextInput/BaseTextInput.js @@ -190,6 +190,7 @@ class BaseTextInput extends Component { const hasLabel = Boolean(this.props.label.length); const inputHelpText = this.props.errorText || this.props.hint; const formHelpStyles = this.props.errorText ? styles.formError : styles.formHelp; + const placeholder = (this.props.prefixCharacter || this.state.isFocused || !hasLabel || (hasLabel && this.props.forceActiveLabel)) ? this.props.placeholder : null; const textInputContainerStyles = _.reduce([ styles.textInputContainer, ...this.props.textInputContainerStyles, @@ -251,16 +252,7 @@ class BaseTextInput extends Component { // eslint-disable-next-line {...inputProps} defaultValue={this.state.value} - placeholder={ - ( - this.props.prefixCharacter - || this.state.isFocused - || !hasLabel - || (hasLabel && this.props.forceActiveLabel) - ) - ? this.props.placeholder - : null - } + placeholder={placeholder} placeholderTextColor={themeColors.placeholderText} underlineColorAndroid="transparent" style={[ diff --git a/src/components/TextInput/baseTextInputPropTypes.js b/src/components/TextInput/baseTextInputPropTypes.js index e6a612d73205..89ea048cd35d 100644 --- a/src/components/TextInput/baseTextInputPropTypes.js +++ b/src/components/TextInput/baseTextInputPropTypes.js @@ -57,7 +57,6 @@ const propTypes = { prefixCharacter: PropTypes.string, /** Form props */ - /** Indicates that the input is being used with the Form component */ isFormInput: PropTypes.bool, diff --git a/src/stories/Composer.stories.js b/src/stories/Composer.stories.js index 486b2afa61e9..6e3be856668c 100644 --- a/src/stories/Composer.stories.js +++ b/src/stories/Composer.stories.js @@ -25,9 +25,9 @@ const parser = new ExpensiMark(); const Default = (args) => { const [pastedFile, setPastedFile] = useState(null); const [comment, setComment] = useState(args.defaultValue); - const renderedHTML = parser.replace(comment); const [droppingFile, setDroppingFile] = useState(false); const [isComposerDroppingTarget, setIsComposerDroppingTarget] = useState(false); + const renderedHTML = parser.replace(comment); return (