Fix accessibility and consistency of MessageComposerButtons (#7679)

This commit is contained in:
Michael Telatynski 2022-01-31 16:05:05 +00:00 committed by GitHub
parent a17d585a12
commit 991257cbc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 94 additions and 75 deletions

View file

@ -330,7 +330,10 @@ export default class MessageComposer extends React.Component<IProps, IState> {
};
private setStickerPickerOpen = (isStickerPickerOpen: boolean) => {
this.setState({ isStickerPickerOpen });
this.setState({
isStickerPickerOpen,
isMenuOpen: false,
});
};
private toggleButtonMenu = (): void => {
@ -453,7 +456,12 @@ export default class MessageComposer extends React.Component<IProps, IState> {
menuPosition={menuPosition}
narrowMode={this.state.narrowMode}
relation={this.props.relation}
onRecordStartEndClick={() => this.voiceRecordingButton.current?.onRecordStartEndClick()}
onRecordStartEndClick={() => {
this.voiceRecordingButton.current?.onRecordStartEndClick();
if (this.state.narrowMode) {
this.toggleButtonMenu();
}
}}
setStickerPickerOpen={this.setStickerPickerOpen}
showLocationButton={this.state.showLocationButton}
showStickersButton={this.state.showStickersButton}