Skip to content

Commit

Permalink
Fix Disabled component infinite loop for a elements (#24935)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-szabo97 committed Aug 31, 2020
1 parent ab0d01b commit 8f8078c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/components/src/disabled/index.js
Expand Up @@ -51,7 +51,8 @@ function Disabled( { className, children, ...props } ) {
focusable.setAttribute( 'tabindex', -1 );
}

if ( focusable.hasAttribute( 'tabindex' ) ) {
const tabIndex = focusable.getAttribute( 'tabindex' );
if ( tabIndex !== null && tabIndex !== '-1' ) {
focusable.removeAttribute( 'tabindex' );
}

Expand Down

0 comments on commit 8f8078c

Please sign in to comment.