Skip to content

Commit

Permalink
use rAF
Browse files Browse the repository at this point in the history
  • Loading branch information
dlockhart committed Oct 18, 2024
1 parent ca09b5b commit dafd07a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/paging/pager-load-more.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class LoadMore extends PageableSubscriberMixin(FocusMixin(LocalizeCoreElement(Rt
this._loading = false;

// wait a frame for async sub-components to render
await new Promise(resolve => requestAnimationFrame(resolve));
await new Promise(requestAnimationFrame);

const item = pageable._getItemByIndex(lastItemIndex + 1);

Expand All @@ -151,7 +151,7 @@ class LoadMore extends PageableSubscriberMixin(FocusMixin(LocalizeCoreElement(Rt
itemToFocus.focus();
}

await new Promise(setTimeout);
await new Promise(requestAnimationFrame);
this.dispatchEvent(new CustomEvent('d2l-pager-load-more-loaded', {
bubbles: false,
composed: false
Expand Down

0 comments on commit dafd07a

Please sign in to comment.