Skip to content

Commit 4e4fca3

Browse files
committed
Docs - Fix wrong method name in buttons guide
1 parent afe862c commit 4e4fca3

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

website/src/content/v9/code-snippets/guides/previous-and-next-buttons/buttons-state-vanilla-01.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ const nextButtonNode = wrapperNode.querySelector('.embla__next')
77

88
const emblaApi = EmblaCarousel(viewportNode, { loop: false })
99

10-
prevButtonNode.addEventListener('click', () => emblaApi.scrollToPrev(), false)
11-
nextButtonNode.addEventListener('click', () => emblaApi.scrollToNext(), false)
10+
prevButtonNode.addEventListener('click', () => emblaApi.goToPrev(), false)
11+
nextButtonNode.addEventListener('click', () => emblaApi.goToNext(), false)
1212

1313
const toggleButtonsDisabled = (emblaApi) => {
1414
const setButtonState = (button, enabled) => {
1515
button.toggleAttribute('disabled', !enabled)
1616
}
17-
setButtonState(prevButtonNode, emblaApi.canScrollToPrev())
18-
setButtonState(nextButtonNode, emblaApi.canScrollToNext())
17+
setButtonState(prevButtonNode, emblaApi.canGoToPrev())
18+
setButtonState(nextButtonNode, emblaApi.canGoToNext())
1919
}
2020

2121
toggleButtonsDisabled(emblaApi)

website/src/content/v9/pages/guides/alignments.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Before continuing with this guide, make sure you've completed the following:
3838

3939
## Understanding alignment
4040

41-
Embla measures each slide's **actual layout position and size** — the values the browser computes after rendering. It then applies the selected [`align`](/api/options/#align) option (`start`, `center`, or `end`) to calculate where each **snap point** should land within the carousel.
41+
Embla measures each slide's **actual layout position and size** — the values the browser computes after rendering. It then applies the selected [`align`](/docs/api/options/#align) option (`start`, `center`, or `end`) to calculate where each **snap point** should land within the carousel.
4242

4343
The `align` option only affects carousels where slides are **less than 100% of the viewport width**, since full-width slides already occupy the entire scroll area.
4444

website/src/content/v9/pages/guides/previous-and-next-buttons.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ If your carousel is [`draggable`](/docs/api/options/#draggable), the **root node
8484

8585
## Adding buttons
8686

87-
Adding navigation buttons is simple. Create your button elements and connect them to Embla's navigation methods — [`goToPrev`](/docs/api/methods/#goToPrev) and [`goToNext`](/docs/api/methods/#goToNext).
87+
Adding navigation buttons is simple. Create your button elements and connect them to Embla's navigation methods — [`goToPrev`](/docs/api/methods/#gotoprev) and [`goToNext`](/docs/api/methods/#gotonext).
8888

8989
These methods let you scroll the carousel programmatically when users click the buttons, giving them an intuitive way to move between slides.
9090

@@ -191,6 +191,6 @@ We'll handle this by toggling each button's state between **enabled** and **disa
191191

192192
- **Button placement:** Place the prev/next buttons **outside** the Embla root element (the one passed to the initializer, e.g. `.embla__viewport`) to prevent accidental drag interactions.
193193
- **Looping carousels:** In **looping** carousels with enough slides to wrap around, the prev/next methods always trigger scrolling — buttons are never disabled.
194-
- **No-op behavior:** On **non-looping** carousels, calling [`goToPrev`](/docs/api/methods/#goToPrev) or [`goToNext`](/docs/api/methods/#goToNext) when already at the first or last slide has no effect. This is normal and ensures consistent, predictable behavior.
194+
- **No-op behavior:** On **non-looping** carousels, calling [`goToPrev`](/docs/api/methods/#gotoprev) or [`goToNext`](/docs/api/methods/#gotonext) when already at the first or last slide has no effect. This is normal and ensures consistent, predictable behavior.
195195

196196
---

0 commit comments

Comments
 (0)