File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -40,15 +40,6 @@ export default class IgcCarouselSlideComponent extends LitElement {
4040
4141 private _carousel ?: IgcCarouselComponent ;
4242
43- // Set carousel reference once provider is ready
44- private readonly _context = createAsyncContext (
45- this ,
46- carouselContext ,
47- ( carousel ) => {
48- this . _carousel = carousel ;
49- }
50- ) ;
51-
5243 protected get _index ( ) : number {
5344 return this . _carousel ? this . _carousel . slides . indexOf ( this ) : 0 ;
5445 }
@@ -82,6 +73,15 @@ export default class IgcCarouselSlideComponent extends LitElement {
8273 @property ( { type : Boolean , reflect : true } )
8374 public previous = false ;
8475
76+ constructor ( ) {
77+ super ( ) ;
78+
79+ // Set carousel reference once provider is ready (addresses Blazor timing issue)
80+ createAsyncContext ( this , carouselContext , ( carousel ) => {
81+ this . _carousel = carousel ;
82+ } ) ;
83+ }
84+
8585 /**
8686 * @hidden @internal
8787 * @deprecated since 5.4.0. Use Carousel's `select` method instead.
You can’t perform that action at this time.
0 commit comments