about summary refs log tree commit diff
path: root/app/javascript/mastodon/components/icon_button.js
diff options
context:
space:
mode:
authorHolden Foreman <38192823+hs4man21@users.noreply.github.com>2023-01-05 07:36:42 -0500
committerGitHub <noreply@github.com>2023-01-05 13:36:42 +0100
commitc5da2f8c439f86f809d750b42aa11cdeef6b7c1f (patch)
treed84f7ffbd336ecde8bad78173ba89f2eb44f72ce /app/javascript/mastodon/components/icon_button.js
parent4dc9152b3e8e390aa18f823e0f5498cd02b8b496 (diff)
Add aria-hidden to 'Hide image' button in MediaGallery since the button is useless to screen reader users (#22513)
Diffstat (limited to 'app/javascript/mastodon/components/icon_button.js')
-rw-r--r--app/javascript/mastodon/components/icon_button.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/javascript/mastodon/components/icon_button.js b/app/javascript/mastodon/components/icon_button.js
index 49858f2e2..b7daf82a4 100644
--- a/app/javascript/mastodon/components/icon_button.js
+++ b/app/javascript/mastodon/components/icon_button.js
@@ -27,6 +27,7 @@ export default class IconButton extends React.PureComponent {
     counter: PropTypes.number,
     obfuscateCount: PropTypes.bool,
     href: PropTypes.string,
+    ariaHidden: PropTypes.bool,
   };
 
   static defaultProps = {
@@ -36,6 +37,7 @@ export default class IconButton extends React.PureComponent {
     animate: false,
     overlay: false,
     tabIndex: '0',
+    ariaHidden: false,
   };
 
   state = {
@@ -102,6 +104,7 @@ export default class IconButton extends React.PureComponent {
       counter,
       obfuscateCount,
       href,
+      ariaHidden,
     } = this.props;
 
     const {
@@ -142,6 +145,7 @@ export default class IconButton extends React.PureComponent {
         type='button'
         aria-label={title}
         aria-expanded={expanded}
+        aria-hidden={ariaHidden}
         title={title}
         className={classes}
         onClick={this.handleClick}