Skip to content

Commit

Permalink
fix(ui): use correct grid container on Resizer to fix Pagination
Browse files Browse the repository at this point in the history
- React-Slickgrid should use `this.elm` directly and doesn't need to query `div` from it, that was only necessary in Aurelia-Slickgrid because it has a `<template>` which React doesn't hence unnecessary to query from
- that also probably means that Example 2 resizer was probably not working as expected (when resizing browser) and now it does
  • Loading branch information
ghiscoding committed Nov 19, 2021
1 parent 549862f commit b00dc98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/react-slickgrid/custom-elements/react-slickgrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ export class ReactSlickgridCustomElement extends React.Component<Props, State> {

// initialized the resizer service only after SlickGrid is initialized
// if we don't we end up binding our resize to a grid element that doesn't yet exist in the DOM and the resizer service will fail silently (because it has a try/catch that unbinds the resize without throwing back)
const gridContainerElm = this.elm.current?.querySelector('div');
const gridContainerElm = this.elm.current;
if (gridContainerElm) {
this.resizerService.init(this.grid, gridContainerElm);
}
Expand Down

0 comments on commit b00dc98

Please sign in to comment.