Skip to content

Commit

Permalink
Speak: Add/complete audible feedback for link editing (#10795)
Browse files Browse the repository at this point in the history
* Speak ‘link removed’ when a link is removed

* Speak ‘link edited’ when a link is edited
  • Loading branch information
Adam Silverstein authored and tofumatt committed Oct 23, 2018
1 parent 400b9f4 commit fa895eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Expand Up @@ -2,7 +2,10 @@
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { Toolbar } from '@wordpress/components';
import {
Toolbar,
withSpokenMessages,
} from '@wordpress/components';
import { rawShortcut } from '@wordpress/keycodes';
import { Component } from '@wordpress/element';
import {
Expand Down Expand Up @@ -48,6 +51,7 @@ class FormatToolbar extends Component {

removeLink() {
this.removeFormat( 'a' );
this.props.speak( __( 'Link removed.' ), 'assertive' );
}

addLink() {
Expand Down Expand Up @@ -155,4 +159,4 @@ class FormatToolbar extends Component {
}
}

export default FormatToolbar;
export default withSpokenMessages( FormatToolbar );
Expand Up @@ -167,6 +167,10 @@ class LinkContainer extends Component {
this.props.applyFormat( format );
}

if ( this.state.editLink ) {
this.props.speak( __( 'Link edited.' ), 'assertive' );
}

this.resetState();

if ( ! link ) {
Expand Down

0 comments on commit fa895eb

Please sign in to comment.