diff --git a/src/components/a11y/a11y.js b/src/components/a11y/a11y.js index eb361209e..849564fb7 100644 --- a/src/components/a11y/a11y.js +++ b/src/components/a11y/a11y.js @@ -165,7 +165,7 @@ const A11y = { if (params.itemRoleDescriptionMessage) { swiper.a11y.addElRoleDescription($(swiper.slides), params.itemRoleDescriptionMessage); } - swiper.a11y.addElRole($(swiper.slides), 'group'); + swiper.a11y.addElRole($(swiper.slides), params.slideRole); swiper.slides.each((slideEl) => { const $slideEl = $(slideEl); const ariaLabelMessage = params.slideLabelMessage @@ -267,6 +267,7 @@ export default { containerMessage: null, containerRoleDescriptionMessage: null, itemRoleDescriptionMessage: null, + slideRole: 'group', }, }, create() { diff --git a/src/types/components/a11y.d.ts b/src/types/components/a11y.d.ts index d85f3dfc4..bcb624ae5 100644 --- a/src/types/components/a11y.d.ts +++ b/src/types/components/a11y.d.ts @@ -79,4 +79,11 @@ export interface A11yOptions { * @default '{{index}} / {{slidesLength}}' */ slideLabelMessage?: string; + + /** + * Value of swiper slide `role` attribute + * + * @default 'group' + */ + slideRole?: string; }