Skip to content

Commit

Permalink
♿ Remove tabindex to reduce tabs for modal trap
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckcarpenter committed Dec 31, 2024
1 parent af4d0c6 commit 66ab2db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion shepherd.js/src/components/shepherd-content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
export let descriptionId, labelId, step;
</script>

<div class="shepherd-content" tabindex="0">
<div class="shepherd-content">
{#if !isUndefined(step.options.title) || (step.options.cancelIcon && step.options.cancelIcon.enabled)}
<ShepherdHeader {labelId} {step} />
{/if}
Expand Down
3 changes: 2 additions & 1 deletion test/cypress/integration/a11y.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ describe('a11y', () => {

cy.document().then(() => {
cy.wait(1000);
cy.get('.shepherd-content').tab().tab().tab().tab().tab().tab().tab();
// Tabbing out of the modal should not be possible and we test this by tabbing from the body
cy.get('body').tab().tab().tab().tab().tab().tab();
cy.get('[data-test-popper-link]').should('have.focus');
});
});
Expand Down

0 comments on commit 66ab2db

Please sign in to comment.