]> cat aescling's git repositories - mastodon.git/commitdiff
Fix off-by-one error in aria-posinset (#8388)
authorEugen Rochko <eugen@zeonfederated.com>
Thu, 23 Aug 2018 16:28:59 +0000 (18:28 +0200)
committerGitHub <noreply@github.com>
Thu, 23 Aug 2018 16:28:59 +0000 (18:28 +0200)
Fix #8191

app/javascript/mastodon/components/intersection_observer_article.js

index e2ce9ec9651b819346f232a4eb34d17455ffd355..de2203a4bc4c6975bf5f29d4ad5a8ecb118c3e4a 100644 (file)
@@ -109,7 +109,7 @@ export default class IntersectionObserverArticle extends React.Component {
       return (
         <article
           ref={this.handleRef}
-          aria-posinset={index}
+          aria-posinset={index + 1}
           aria-setsize={listLength}
           style={{ height: `${this.height || cachedHeight}px`, opacity: 0, overflow: 'hidden' }}
           data-id={id}
@@ -121,7 +121,7 @@ export default class IntersectionObserverArticle extends React.Component {
     }
 
     return (
-      <article ref={this.handleRef} aria-posinset={index} aria-setsize={listLength} data-id={id} tabIndex='0'>
+      <article ref={this.handleRef} aria-posinset={index + 1} aria-setsize={listLength} data-id={id} tabIndex='0'>
         {children && React.cloneElement(children, { hidden: false })}
       </article>
     );