Skip to content

Commit

Permalink
fix(ebay-carousel): fix width calculation for last pill when font not…
Browse files Browse the repository at this point in the history
… loaded (#2352)
  • Loading branch information
WinkeeFace authored Dec 20, 2024
1 parent 3b77fd2 commit a5b2e69
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-grapes-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ebay/ebayui-core": minor
---

fix(ebay-carousel): fix width calculation for last pill when font not loaded (#2344)
10 changes: 5 additions & 5 deletions src/components/ebay-carousel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
</span>
</h1>

Descrete or Continuious carousel component. Can show items as a slide or various widths.
Discrete or Continuous carousel component. Can show items as a slide or various widths.

## Examples and Documentation

- [Storybook](https://ebay.github.io/ebayui-core/?path=/story/navigation-disclosure-ebay-carousel)
- [Storybook Docs](https://ebay.github.io/ebayui-core/?path=/docs/navigation-disclosure-ebay-carousel)
- [Code Examples](https://github.com/eBay/ebayui-core/tree/master/src/components/ebay-carousel/examples)
- [Storybook](https://ebay.github.io/ebayui-core/?path=/story/navigation-disclosure-ebay-carousel)
- [Storybook Docs](https://ebay.github.io/ebayui-core/?path=/docs/navigation-disclosure-ebay-carousel)
- [Code Examples](https://github.com/eBay/ebayui-core/tree/master/src/components/ebay-carousel/examples)

## Preserving tabindex for focusable elements

Expand All @@ -22,4 +22,4 @@ In order to preserve the tabindex on an item, pass `data-carousel-tabindex="-1"`

## Reduced motion

The carousel doesnot autoplay by respecting the `prefers-reduced-motion` media query. Toggle your reduced motion settings to view autoplay example with the default behavior and reduced motion behavior.
The carousel does not autoplay by respecting the `prefers-reduced-motion` media query. Toggle your reduced motion settings to view autoplay example with the default behavior and reduced motion behavior.
9 changes: 7 additions & 2 deletions src/components/ebay-carousel/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ class Carousel extends Marko.Component<Input, State> {
if (!config.scrollTransitioning) {
this.handleScroll(this.listEl.scrollLeft);
}
}),
})
);
} else {
this.subscribeTo(this.listEl).on("transitionend", ({ target }) => {
Expand All @@ -540,8 +540,13 @@ class Carousel extends Marko.Component<Input, State> {
}
});
}

this.onRenderLegacy();

document.fonts.ready.then(() => {
this.cleanupAsync();
this.onRenderLegacy();
});

}

onUpdate() {
Expand Down

0 comments on commit a5b2e69

Please sign in to comment.