-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IndexTable] Fix UX / jank when resizing (#4033)
* Fix indextable UX / jank when resizing
- Loading branch information
Showing
7 changed files
with
186 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {getTableHeadingsBySelector} from './utilities'; |
16 changes: 16 additions & 0 deletions
16
src/components/IndexTable/utilities/tests/utilities.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {getTableHeadingsBySelector} from '../utilities'; | ||
|
||
describe('#getTableHeadingsBySelector', function () { | ||
it('returns empty array when no wrapper is passed', () => { | ||
expect(getTableHeadingsBySelector(null, '')).toStrictEqual([]); | ||
}); | ||
|
||
it('returns array when wrapper is passed', () => { | ||
const response = [{id: 'test'}]; | ||
const fakeElement = ({ | ||
querySelectorAll: () => response, | ||
} as unknown) as HTMLElement; | ||
|
||
expect(getTableHeadingsBySelector(fakeElement, '')).toStrictEqual(response); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export function getTableHeadingsBySelector( | ||
wrapperElement: HTMLElement | null, | ||
selector: string, | ||
) { | ||
return wrapperElement | ||
? Array.from(wrapperElement.querySelectorAll<HTMLElement>(selector)) | ||
: []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters