feat: ✨ make slider nav optional
This commit is contained in:
parent
f5d526d79b
commit
6e77bf539b
1 changed files with 3 additions and 3 deletions
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
const updateActiveStates = () => {
|
const updateActiveStates = () => {
|
||||||
items.forEach(updateAriaCurrent);
|
items.forEach(updateAriaCurrent);
|
||||||
nav.querySelectorAll('.indicator-btn').forEach(updateAriaCurrent);
|
nav?.querySelectorAll('.indicator-btn').forEach(updateAriaCurrent);
|
||||||
prevButton.disabled = isAtStart();
|
prevButton.disabled = isAtStart();
|
||||||
nextButton.disabled = isAtEnd();
|
nextButton.disabled = isAtEnd();
|
||||||
};
|
};
|
||||||
|
@ -81,7 +81,7 @@
|
||||||
el.setAttribute('tabindex', '0');
|
el.setAttribute('tabindex', '0');
|
||||||
el.setAttribute('role', 'group');
|
el.setAttribute('role', 'group');
|
||||||
|
|
||||||
nav.appendChild(btn);
|
nav?.appendChild(btn);
|
||||||
});
|
});
|
||||||
|
|
||||||
updateActiveStates();
|
updateActiveStates();
|
||||||
|
@ -106,7 +106,7 @@
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav class="slider-nav" aria-label="Slider"></nav>
|
<nav webc:if="nav !== false" class="slider-nav" aria-label="Slider"></nav>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<style webc:scoped="slider">
|
<style webc:scoped="slider">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue