Skip to content

Commit c182a12

Browse files
committed
fix(ebay-carousel): fix width calculation for last pill when font not loaded
1 parent 28d92d0 commit c182a12

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

.changeset/strong-grapes-work.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ebay/ebayui-core": minor
3+
---
4+
5+
fix(ebay-carousel): fix width calculation for last pill when font not loaded (#2344)

src/components/ebay-carousel/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
</span>
88
</h1>
99

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

1212
## Examples and Documentation
1313

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

1818
## Preserving tabindex for focusable elements
1919

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

2323
## Reduced motion
2424

25-
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.
25+
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.

src/components/ebay-carousel/component.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ class Carousel extends Marko.Component<Input, State> {
531531
if (!config.scrollTransitioning) {
532532
this.handleScroll(this.listEl.scrollLeft);
533533
}
534-
}),
534+
})
535535
);
536536
} else {
537537
this.subscribeTo(this.listEl).on("transitionend", ({ target }) => {
@@ -541,7 +541,11 @@ class Carousel extends Marko.Component<Input, State> {
541541
});
542542
}
543543

544-
this.onRenderLegacy();
544+
document.fonts.ready.then(() => {
545+
this.cleanupAsync();
546+
this.onRenderLegacy();
547+
});
548+
545549
}
546550

547551
onUpdate() {

0 commit comments

Comments
 (0)