Skip to content

Commit

Permalink
fix(form): handle undefined element
Browse files Browse the repository at this point in the history
The element sometimes seems to be undefined, causing some flaky integration tests in some browsers
  • Loading branch information
jgroth authored and hannahu committed Nov 8, 2024
1 parent 6f34686 commit 8e65007
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/form/templates/grid-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export class GridLayout extends React.Component<LayoutProps, LayoutState> {
public handleResize() {
requestAnimationFrame(() => {
const element = this.elementRef.current;
if (!element) {
return;
}

const width = element.getBoundingClientRect().width;
const maxColumns = Math.min(
MAX_COLUMNS,
Expand Down

0 comments on commit 8e65007

Please sign in to comment.