fix(carousel): navigation arrow directionality for ltr/rtl

alenaksu/fix/carousel-navigation-icons
Alessandro 2024-10-25 08:51:06 +00:00 zatwierdzone przez GitHub
rodzic 09024cfee5
commit 32f3eb7ebb
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 3 dodań i 3 usunięć
src/components/carousel

Wyświetl plik

@ -512,7 +512,7 @@ export default class SlCarousel extends ShoelaceElement {
const currentPage = this.getCurrentPage();
const prevEnabled = this.canScrollPrev();
const nextEnabled = this.canScrollNext();
const isLtr = this.localize.dir() === 'rtl';
const isRtl = this.localize.dir() === 'rtl';
return html`
<div part="base" class="carousel">
@ -553,7 +553,7 @@ export default class SlCarousel extends ShoelaceElement {
@click=${prevEnabled ? () => this.previous() : null}
>
<slot name="previous-icon">
<sl-icon library="system" name="${isLtr ? 'chevron-left' : 'chevron-right'}"></sl-icon>
<sl-icon library="system" name="${isRtl ? 'chevron-right' : 'chevron-left'}"></sl-icon>
</slot>
</button>
@ -570,7 +570,7 @@ export default class SlCarousel extends ShoelaceElement {
@click=${nextEnabled ? () => this.next() : null}
>
<slot name="next-icon">
<sl-icon library="system" name="${isLtr ? 'chevron-right' : 'chevron-left'}"></sl-icon>
<sl-icon library="system" name="${isRtl ? 'chevron-left' : 'chevron-right'}"></sl-icon>
</slot>
</button>
</div>