Fix off-by-one error in aria-posinset (#8388)

Fix #8191
This commit is contained in:
Eugen Rochko 2018-08-23 18:28:59 +02:00 committed by GitHub
parent 66dbb59aa1
commit 885711afb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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>
);