@@ -53,9 +53,10 @@ const ShareURL = ({ value }) => {
5353 < button
5454 className = "collection-share__button"
5555 onClick = { ( ) => setShowURL ( ! showURL ) }
56+ aria-label = "Show collection share URL"
5657 >
5758 < span > Share</ span >
58- < DropdownArrowIcon className = "collection-share__arrow" />
59+ < DropdownArrowIcon className = "collection-share__arrow" focusable = "false" aria-hidden = "true" />
5960 </ button >
6061 { showURL &&
6162 < div className = "collection__share-dropdown" >
@@ -97,8 +98,9 @@ class CollectionItemRowBase extends React.Component {
9798 < button
9899 className = "collection-row__remove-button"
99100 onClick = { this . handleSketchRemove }
101+ aria-label = "Remove sketch from collection"
100102 >
101- < RemoveIcon title = "Remove " />
103+ < RemoveIcon focusable = "false" aria-hidden = "true " />
102104 </ button >
103105 </ td >
104106 </ tr > ) ;
@@ -295,21 +297,43 @@ class Collection extends React.Component {
295297 return null ;
296298 }
297299
300+ _getButtonLabel = ( fieldName , displayName ) => {
301+ const { field, direction } = this . props . sorting ;
302+ let buttonLabel ;
303+ if ( field !== fieldName ) {
304+ if ( field === 'name' ) {
305+ buttonLabel = `Sort by ${ displayName } ascending.` ;
306+ } else {
307+ buttonLabel = `Sort by ${ displayName } descending.` ;
308+ }
309+ } else if ( direction === SortingActions . DIRECTION . ASC ) {
310+ buttonLabel = `Sort by ${ displayName } descending.` ;
311+ } else {
312+ buttonLabel = `Sort by ${ displayName } ascending.` ;
313+ }
314+ return buttonLabel ;
315+ }
316+
298317 _renderFieldHeader ( fieldName , displayName ) {
299318 const { field, direction } = this . props . sorting ;
300319 const headerClass = classNames ( {
301320 'sketches-table__header' : true ,
302321 'sketches-table__header--selected' : field === fieldName
303322 } ) ;
323+ const buttonLabel = this . _getButtonLabel ( fieldName , displayName ) ;
304324 return (
305325 < th scope = "col" >
306- < button className = "sketch-list__sort-button" onClick = { ( ) => this . props . toggleDirectionForField ( fieldName ) } >
326+ < button
327+ className = "sketch-list__sort-button"
328+ onClick = { ( ) => this . props . toggleDirectionForField ( fieldName ) }
329+ aria-label = { buttonLabel }
330+ >
307331 < span className = { headerClass } > { displayName } </ span >
308332 { field === fieldName && direction === SortingActions . DIRECTION . ASC &&
309- < ArrowUpIcon />
333+ < ArrowUpIcon role = "img" aria-label = "Ascending" focusable = "false" />
310334 }
311335 { field === fieldName && direction === SortingActions . DIRECTION . DESC &&
312- < ArrowDownIcon />
336+ < ArrowDownIcon role = "img" aria-label = "Descending" focusable = "false" />
313337 }
314338 </ button >
315339 </ th >
0 commit comments