diff --git a/native/chat/chat-input-bar.react.js b/native/chat/chat-input-bar.react.js --- a/native/chat/chat-input-bar.react.js +++ b/native/chat/chat-input-bar.react.js @@ -313,9 +313,10 @@ +setText: (text: string) => void, +textEdited: boolean, +setTextEdited: (edited: boolean) => void, + +buttonsExpanded: boolean, + +setButtonsExpanded: (expanded: boolean) => void, }; type State = { - +buttonsExpanded: boolean, +isExitingDuringEditMode: boolean, }; class ChatInputBar extends React.PureComponent { @@ -341,7 +342,6 @@ constructor(props: Props) { super(props); this.state = { - buttonsExpanded: true, isExitingDuringEditMode: false, }; @@ -801,7 +801,7 @@ - {this.state.buttonsExpanded ? expandoButton : null} + {this.props.buttonsExpanded ? expandoButton : null} - {this.state.buttonsExpanded ? null : expandoButton} + {this.props.buttonsExpanded ? null : expandoButton} { - if (this.state.buttonsExpanded || this.isEditMode()) { + if (this.props.buttonsExpanded || this.isEditMode()) { return; } this.targetExpandoButtonsOpen.setValue(1); - this.setState({ buttonsExpanded: true }); + this.props.setButtonsExpanded(true); }; hideButtons() { if ( ChatInputBar.mediaGalleryOpen(this.props) || !this.systemKeyboardShowing || - !this.state.buttonsExpanded + !this.props.buttonsExpanded ) { return; } this.targetExpandoButtonsOpen.setValue(0); - this.setState({ buttonsExpanded: false }); + this.props.setButtonsExpanded(false); } immediatelyHideButtons() { this.expandoButtonsOpen.setValue(0); this.targetExpandoButtonsOpen.setValue(0); - this.setState({ buttonsExpanded: false }); + this.props.setButtonsExpanded(false); } showMediaGallery = () => { @@ -1303,6 +1303,7 @@ const [text, setText] = React.useState(draft); const [textEdited, setTextEdited] = React.useState(false); + const [buttonsExpanded, setButtonsExpanded] = React.useState(true); const typeaheadRegexMatches = React.useMemo( () => @@ -1390,6 +1391,8 @@ setText={setText} textEdited={textEdited} setTextEdited={setTextEdited} + buttonsExpanded={buttonsExpanded} + setButtonsExpanded={setButtonsExpanded} /> ); }