Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(storefront): BCTHEME-344 Carousel buttons do not receive focus #1937

Merged
merged 3 commits into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Draft
- Carousel buttons do not receive focus. [#1937](https://github.com/bigcommerce/cornerstone/pull/1937)
- Empty cart message not read by screen reader. [#1935](https://github.com/bigcommerce/cornerstone/pull/1935)
- No tooltips provided for carousel buttons. [#1934](https://github.com/bigcommerce/cornerstone/pull/1934)
- Added announcement on shipping estimator errors. [#1932](https://github.com/bigcommerce/cornerstone/pull/1932)
Expand Down
2 changes: 1 addition & 1 deletion assets/js/theme/common/carousel/utils/setTabindexes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default ($slides, $prevArrow, $nextArrow, actualSlide, actualSlideCount)
$slides.each((index, element) => {
const $element = $(element);
const tabIndex = $element.hasClass('slick-active') ? 0 : -1;
if (!$element.hasClass('js-product-slide')) {
if ($element.attr('href') !== undefined) {
$element.attr('tabindex', tabIndex);
}

Expand Down
2 changes: 1 addition & 1 deletion templates/components/carousel-content.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<span class="heroCarousel-title">{{{heading}}}</span>
<p class="heroCarousel-description">{{{text}}}</p>
{{#if button_text}}
<span class="heroCarousel-action button button--primary button--large">{{button_text}}</span>
<a href="{{url}}" aria-label="{{#if this.alt_text.length '!=' 0}}{{this.alt_text}}{{else}}{{lang 'common.carousel_slide_number' slide_number=(add @index 1)}}{{/if}}, {{button_text}}" class="heroCarousel-action button button--primary button--large">{{button_text}}</a>
{{/if}}
</div>
8 changes: 8 additions & 0 deletions templates/components/carousel.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
<button aria-label="{{lang 'carousel.arrowAriaLabel'}} {{carousel.slides.length}}" class="js-hero-prev-arrow slick-prev slick-arrow"></button>
{{/and}}
{{#each carousel.slides}}
{{#if button_text}}
<div class="js-hero-slide">
{{else}}
<a href="{{url}}" class="js-hero-slide" aria-label="{{#if this.alt_text.length '!=' 0}}{{this.alt_text}}{{else}}{{lang 'common.carousel_slide_number' slide_number=(add @index 1)}}{{/if}}">
{{/if}}
<div class="heroCarousel-slide {{#if ../theme_settings.homepage_stretch_carousel_images}}stretch{{/if}} {{#if @first}}heroCarousel-slide--first{{/if}}">
<div class="heroCarousel-image-wrapper">
{{#if @first}}
Expand Down Expand Up @@ -50,7 +54,11 @@
{{/if}}
{{/if}}
</div>
{{#if button_text}}
</div>
{{else}}
</a>
{{/if}}
{{/each}}
{{#and arrows (if carousel.slides.length '>' 1)}}
<button aria-label="{{lang 'carousel.arrowAriaLabel'}} {{carousel.slides.length}}" class="js-hero-next-arrow slick-next slick-arrow"></button>
Expand Down