Skip to content

Commit 142caf5

Browse files
♿ Remove tabindex to reduce tabs for modal trap (#3083)
1 parent af4d0c6 commit 142caf5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

shepherd.js/src/components/shepherd-content.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
export let descriptionId, labelId, step;
88
</script>
99

10-
<div class="shepherd-content" tabindex="0">
10+
<div class="shepherd-content">
1111
{#if !isUndefined(step.options.title) || (step.options.cancelIcon && step.options.cancelIcon.enabled)}
1212
<ShepherdHeader {labelId} {step} />
1313
{/if}

test/cypress/integration/a11y.cy.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ describe('a11y', () => {
7575

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

0 commit comments

Comments
 (0)