Don't speak the outgoing message if it is in the Sending state.

Signed-off-by: Marco Zehe <marcozehe@mailbox.org>
pull/21833/head
Marco Zehe 2020-02-14 12:34:22 +01:00
parent 5325b5677f
commit 7e4bbfebc6
1 changed files with 7 additions and 4 deletions

View File

@ -671,6 +671,9 @@ export default createReactClass({
mx_EventTile_redacted: isRedacted, mx_EventTile_redacted: isRedacted,
}); });
// If the tile is in the Sending state, don't speak the message.
const suppressSpeech = (isSending) ? "off" : undefined;
let permalink = "#"; let permalink = "#";
if (this.props.permalinkCreator) { if (this.props.permalinkCreator) {
permalink = this.props.permalinkCreator.forEvent(this.props.mxEvent.getId()); permalink = this.props.permalinkCreator.forEvent(this.props.mxEvent.getId());
@ -789,7 +792,7 @@ export default createReactClass({
case 'notif': { case 'notif': {
const room = this.context.getRoom(this.props.mxEvent.getRoomId()); const room = this.context.getRoom(this.props.mxEvent.getRoomId());
return ( return (
<div className={classes}> <div className={classes} aria-live={suppressSpeech}>
<div className="mx_EventTile_roomName"> <div className="mx_EventTile_roomName">
<a href={permalink} onClick={this.onPermalinkClicked}> <a href={permalink} onClick={this.onPermalinkClicked}>
{ room ? room.name : '' } { room ? room.name : '' }
@ -815,7 +818,7 @@ export default createReactClass({
} }
case 'file_grid': { case 'file_grid': {
return ( return (
<div className={classes}> <div className={classes} aria-live={suppressSpeech}>
<div className="mx_EventTile_line"> <div className="mx_EventTile_line">
<EventTileType ref={this._tile} <EventTileType ref={this._tile}
mxEvent={this.props.mxEvent} mxEvent={this.props.mxEvent}
@ -851,7 +854,7 @@ export default createReactClass({
); );
} }
return ( return (
<div className={classes}> <div className={classes} aria-live={suppressSpeech}>
{ avatar } { avatar }
{ sender } { sender }
<div className="mx_EventTile_reply"> <div className="mx_EventTile_reply">
@ -879,7 +882,7 @@ export default createReactClass({
); );
// tab-index=-1 to allow it to be focusable but do not add tab stop for it, primarily for screen readers // tab-index=-1 to allow it to be focusable but do not add tab stop for it, primarily for screen readers
return ( return (
<div className={classes} tabIndex={-1}> <div className={classes} tabIndex={-1} aria-live={suppressSpeech}>
<div className="mx_EventTile_msgOption"> <div className="mx_EventTile_msgOption">
{ readAvatars } { readAvatars }
</div> </div>