mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
backport SL-2353
This commit is contained in:
@@ -19,6 +19,8 @@ During the alpha period, things might break! We take breaking changes very serio
|
||||
- Fixed a number of broken event listeners throughout the docs
|
||||
- Fixed a bug in `<wa-card>` that prevented slots from showing automatically without `with-` attributes
|
||||
- Fixed a bug in `<wa-select>` that prevented the placeholder color from being customized with the `--wa-form-control-placeholder-color` token
|
||||
- Improved accessibility of `<wa-carousel>`
|
||||
|
||||
|
||||
## 3.0.0-alpha.10
|
||||
|
||||
|
||||
@@ -378,8 +378,16 @@ export default class WaCarousel extends WebAwesomeElement {
|
||||
this.getSlides({ excludeClones: false }).forEach((slide, index) => {
|
||||
slide.classList.remove('--in-view');
|
||||
slide.classList.remove('--is-active');
|
||||
slide.setAttribute('role', 'group');
|
||||
slide.setAttribute('aria-label', this.localize.term('slideNum', index + 1));
|
||||
|
||||
if (this.pagination) {
|
||||
slide.setAttribute('role', 'tabpanel');
|
||||
slide.removeAttribute('aria-label');
|
||||
slide.setAttribute('aria-labelledby', `tab-${index + 1}`);
|
||||
slide.setAttribute('id', `slide-${index + 1}`);
|
||||
}
|
||||
|
||||
if (slide.hasAttribute('data-clone')) {
|
||||
slide.remove();
|
||||
}
|
||||
@@ -633,7 +641,7 @@ export default class WaCarousel extends WebAwesomeElement {
|
||||
: ''}
|
||||
${this.pagination
|
||||
? html`
|
||||
<div part="pagination" role="tablist" class="pagination" aria-controls="scroll-container">
|
||||
<div part="pagination" role="tablist" class="pagination">
|
||||
${map(range(pagesCount), index => {
|
||||
const isActive = index === currentPage;
|
||||
return html`
|
||||
@@ -644,8 +652,10 @@ export default class WaCarousel extends WebAwesomeElement {
|
||||
'pagination-item--active': isActive,
|
||||
})}"
|
||||
role="tab"
|
||||
id="tab-${index + 1}"
|
||||
aria-controls="slide-${index + 1}"
|
||||
aria-selected="${isActive ? 'true' : 'false'}"
|
||||
aria-label="${this.localize.term('goToSlide', index + 1, pagesCount)}"
|
||||
${isActive ? '' : `aria-label="${this.localize.term('goToSlide', index + 1, pagesCount)}"`}
|
||||
tabindex=${isActive ? '0' : '-1'}
|
||||
@click=${() => this.goToSlide(index * slidesPerMove)}
|
||||
@keydown=${this.handleKeyDown}
|
||||
|
||||
Reference in New Issue
Block a user