Skip to content

Commit

Permalink
fix: auto-resize not just grid but also headers for Salesforce tabs (#…
Browse files Browse the repository at this point in the history
…1395)

* fix: auto-resize not just grid but also headers for Salesforce tabs
- when switching Tabs in Salesforce, SlickGrid has problem resizing properly, a prior auto-resize patch was put in place some time ago to call `resizeGrid()` for certain period, but with v3.0 and higher that didn't seem to be enough since the headers were not being resized properly, so let's resize them too by calling `grid.updateColumns()` in the same auto-resize function

* chore: change Husky commitlint body size to unlimited
- I don't care how long the body is but I do care about how long the PR title is (max 72)
  • Loading branch information
ghiscoding committed Feb 14, 2024
1 parent cb15587 commit 6180461
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-max-line-length': [1, 'always', 72],
'footer-max-line-length': [0, 'always'] // Make sure there is never a max-line-length by disabling the rule
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const gridStub = {
setPreHeaderPanelVisibility: jest.fn(),
setOptions: jest.fn(),
setSortColumns: jest.fn(),
updateColumns: jest.fn(),
onColumnsResizeDblClick: new SlickEvent(),
onSort: new SlickEvent(),
} as unknown as SlickGrid;
Expand Down
3 changes: 3 additions & 0 deletions packages/common/src/services/resizer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,9 @@ export class ResizerService {
// visible grid (shown to the user and not hidden in another Tab will have an offsetParent defined)
if (this.checkIsGridShown() && (isResizeRequired || containerElmOffset?.left === 0 || containerElmOffset?.top === 0)) {
await this.resizeGrid();
if (resizeGoodCount < 5) {
this._grid.updateColumns(); // also refresh header titles after grid becomes visible in new tab, this fixes an issue observed in Salesforce
}

// make sure the grid is still visible after doing the resize
if (this.checkIsGridShown()) {
Expand Down
Binary file not shown.

0 comments on commit 6180461

Please sign in to comment.