Skip to content

Commit

Permalink
fix: make sure pager element exists before toggling CSS classes (#1028)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored Jun 19, 2024
1 parent 3d342cc commit fe46af0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/controls/slick.pager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,16 @@ export class SlickGridPager {

// add back disabled class to only necessary icons
if (!state.canGotoFirst) {
this._container!.querySelector('.sgi-chevron-start')!.classList.add('sgi-state-disabled');
this._container!.querySelector('.sgi-chevron-start')?.classList.add('sgi-state-disabled');
}
if (!state.canGotoLast) {
this._container!.querySelector('.sgi-chevron-end')!.classList.add('sgi-state-disabled');
this._container!.querySelector('.sgi-chevron-end')?.classList.add('sgi-state-disabled');
}
if (!state.canGotoNext) {
this._container!.querySelector('.sgi-chevron-right')!.classList.add('sgi-state-disabled');
this._container!.querySelector('.sgi-chevron-right')?.classList.add('sgi-state-disabled');
}
if (!state.canGotoPrev) {
this._container!.querySelector('.sgi-chevron-left')!.classList.add('sgi-state-disabled');
this._container!.querySelector('.sgi-chevron-left')?.classList.add('sgi-state-disabled');
}

if (pagingInfo.pageSize === 0) {
Expand Down

0 comments on commit fe46af0

Please sign in to comment.