From d055d751720b7494ba990a43434b73e17596b5e8 Mon Sep 17 00:00:00 2001 From: Sasha Sorokin <10401817+Brawaru@users.noreply.github.com> Date: Tue, 8 Nov 2022 17:31:32 +0100 Subject: 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 --- app/javascript/mastodon/components/column_header.js | 1 - app/javascript/mastodon/components/icon_button.js | 3 --- app/javascript/mastodon/components/status_action_bar.js | 4 ++-- app/javascript/mastodon/features/hashtag_timeline/index.js | 2 +- app/javascript/mastodon/features/home_timeline/index.js | 1 - .../mastodon/features/picture_in_picture/components/footer.js | 4 ++-- app/javascript/mastodon/features/status/index.js | 2 +- 7 files changed, 6 insertions(+), 11 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/components/column_header.js b/app/javascript/mastodon/components/column_header.js index 43efa179e..7850a93ec 100644 --- a/app/javascript/mastodon/components/column_header.js +++ b/app/javascript/mastodon/components/column_header.js @@ -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} > diff --git a/app/javascript/mastodon/components/icon_button.js b/app/javascript/mastodon/components/icon_button.js index 8fd9e10c0..49858f2e2 100644 --- a/app/javascript/mastodon/components/icon_button.js +++ b/app/javascript/mastodon/components/icon_button.js @@ -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 { ); diff --git a/app/javascript/mastodon/features/home_timeline/index.js b/app/javascript/mastodon/features/home_timeline/index.js index 749a47e76..ae11ccbe4 100644 --- a/app/javascript/mastodon/features/home_timeline/index.js +++ b/app/javascript/mastodon/features/home_timeline/index.js @@ -130,7 +130,6 @@ class HomeTimeline extends React.PureComponent { className={classNames('column-header__button', { 'active': showAnnouncements })} title={intl.formatMessage(showAnnouncements ? messages.hide_announcements : messages.show_announcements)} aria-label={intl.formatMessage(showAnnouncements ? messages.hide_announcements : messages.show_announcements)} - aria-pressed={showAnnouncements ? 'true' : 'false'} onClick={this.handleToggleAnnouncementsClick} > diff --git a/app/javascript/mastodon/features/picture_in_picture/components/footer.js b/app/javascript/mastodon/features/picture_in_picture/components/footer.js index 0beb2e14d..5b875dc30 100644 --- a/app/javascript/mastodon/features/picture_in_picture/components/footer.js +++ b/app/javascript/mastodon/features/picture_in_picture/components/footer.js @@ -182,8 +182,8 @@ class Footer extends ImmutablePureComponent { return (
- - + + {withOpenButton && }
); diff --git a/app/javascript/mastodon/features/status/index.js b/app/javascript/mastodon/features/status/index.js index c0ba1f2d6..cb67944c9 100644 --- a/app/javascript/mastodon/features/status/index.js +++ b/app/javascript/mastodon/features/status/index.js @@ -619,7 +619,7 @@ class Status extends ImmutablePureComponent { showBackButton multiColumn={multiColumn} extraButton={( - + )} /> -- cgit