Remove aria-pressed where it's redundant (#19912)
This commit removes aria-pressed attribute from all elements which contents or other descriptive attributes change in active state, effectively replacing the meaning of the button, in which case aria-pressed, an attribute specified whether the button is currently pressed, would create a confusion. (Spoiler: it's everywhere). See https://github.com/mastodon/mastodon/issues/13545#issuecomment-1304886969
This commit is contained in:
		
					parent
					
						
							
								d70303bba6
							
						
					
				
			
			
				commit
				
					
						d055d75172
					
				
			
		
					 7 changed files with 6 additions and 11 deletions
				
			
		|  | @ -152,7 +152,6 @@ class ColumnHeader extends React.PureComponent { | |||
|           className={collapsibleButtonClassName} | ||||
|           title={formatMessage(collapsed ? messages.show : messages.hide)} | ||||
|           aria-label={formatMessage(collapsed ? messages.show : messages.hide)} | ||||
|           aria-pressed={collapsed ? 'false' : 'true'} | ||||
|           onClick={this.handleToggleClick} | ||||
|         > | ||||
|           <i className='icon-with-badge'> | ||||
|  |  | |||
|  | @ -16,7 +16,6 @@ export default class IconButton extends React.PureComponent { | |||
|     onKeyPress: PropTypes.func, | ||||
|     size: PropTypes.number, | ||||
|     active: PropTypes.bool, | ||||
|     pressed: PropTypes.bool, | ||||
|     expanded: PropTypes.bool, | ||||
|     style: PropTypes.object, | ||||
|     activeStyle: PropTypes.object, | ||||
|  | @ -98,7 +97,6 @@ export default class IconButton extends React.PureComponent { | |||
|       icon, | ||||
|       inverted, | ||||
|       overlay, | ||||
|       pressed, | ||||
|       tabIndex, | ||||
|       title, | ||||
|       counter, | ||||
|  | @ -143,7 +141,6 @@ export default class IconButton extends React.PureComponent { | |||
|       <button | ||||
|         type='button' | ||||
|         aria-label={title} | ||||
|         aria-pressed={pressed} | ||||
|         aria-expanded={expanded} | ||||
|         title={title} | ||||
|         className={classes} | ||||
|  |  | |||
|  | @ -361,8 +361,8 @@ class StatusActionBar extends ImmutablePureComponent { | |||
|     return ( | ||||
|       <div className='status__action-bar'> | ||||
|         <IconButton className='status__action-bar__button' title={replyTitle} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} onClick={this.handleReplyClick} counter={status.get('replies_count')} obfuscateCount /> | ||||
|         <IconButton className={classNames('status__action-bar__button', { reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} pressed={status.get('reblogged')} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} counter={withCounters ? status.get('reblogs_count') : undefined} /> | ||||
|         <IconButton className='status__action-bar__button star-icon' animate active={status.get('favourited')} pressed={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} counter={withCounters ? status.get('favourites_count') : undefined} /> | ||||
|         <IconButton className={classNames('status__action-bar__button', { reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} counter={withCounters ? status.get('reblogs_count') : undefined} /> | ||||
|         <IconButton className='status__action-bar__button star-icon' animate active={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} counter={withCounters ? status.get('favourites_count') : undefined} /> | ||||
|         <IconButton className='status__action-bar__button bookmark-icon' disabled={!signedIn} active={status.get('bookmarked')} title={intl.formatMessage(messages.bookmark)} icon='bookmark' onClick={this.handleBookmarkClick} /> | ||||
| 
 | ||||
|         {shareButton} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue