mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-19 15:34:15 +00:00
Compare commits
1 Commits
select-css
...
carousel-b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
270403e634 |
@@ -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 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-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
|
- 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
|
## 3.0.0-alpha.10
|
||||||
|
|
||||||
|
|||||||
@@ -378,8 +378,16 @@ export default class WaCarousel extends WebAwesomeElement {
|
|||||||
this.getSlides({ excludeClones: false }).forEach((slide, index) => {
|
this.getSlides({ excludeClones: false }).forEach((slide, index) => {
|
||||||
slide.classList.remove('--in-view');
|
slide.classList.remove('--in-view');
|
||||||
slide.classList.remove('--is-active');
|
slide.classList.remove('--is-active');
|
||||||
|
slide.setAttribute('role', 'group');
|
||||||
slide.setAttribute('aria-label', this.localize.term('slideNum', index + 1));
|
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')) {
|
if (slide.hasAttribute('data-clone')) {
|
||||||
slide.remove();
|
slide.remove();
|
||||||
}
|
}
|
||||||
@@ -633,7 +641,7 @@ export default class WaCarousel extends WebAwesomeElement {
|
|||||||
: ''}
|
: ''}
|
||||||
${this.pagination
|
${this.pagination
|
||||||
? html`
|
? html`
|
||||||
<div part="pagination" role="tablist" class="pagination" aria-controls="scroll-container">
|
<div part="pagination" role="tablist" class="pagination">
|
||||||
${map(range(pagesCount), index => {
|
${map(range(pagesCount), index => {
|
||||||
const isActive = index === currentPage;
|
const isActive = index === currentPage;
|
||||||
return html`
|
return html`
|
||||||
@@ -644,8 +652,10 @@ export default class WaCarousel extends WebAwesomeElement {
|
|||||||
'pagination-item--active': isActive,
|
'pagination-item--active': isActive,
|
||||||
})}"
|
})}"
|
||||||
role="tab"
|
role="tab"
|
||||||
|
id="tab-${index + 1}"
|
||||||
|
aria-controls="slide-${index + 1}"
|
||||||
aria-selected="${isActive ? 'true' : 'false'}"
|
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'}
|
tabindex=${isActive ? '0' : '-1'}
|
||||||
@click=${() => this.goToSlide(index * slidesPerMove)}
|
@click=${() => this.goToSlide(index * slidesPerMove)}
|
||||||
@keydown=${this.handleKeyDown}
|
@keydown=${this.handleKeyDown}
|
||||||
|
|||||||
Reference in New Issue
Block a user