From 0623497bcaa2095ad6bae70b4230669d4bc166c9 Mon Sep 17 00:00:00 2001 From: Dylan Cooke Date: Tue, 15 Mar 2022 17:29:54 -0400 Subject: [PATCH] fix overflow list in popover --- packages/core/src/components/overflow-list/overflowList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/components/overflow-list/overflowList.tsx b/packages/core/src/components/overflow-list/overflowList.tsx index cf46de776a..a42a1bf774 100644 --- a/packages/core/src/components/overflow-list/overflowList.tsx +++ b/packages/core/src/components/overflow-list/overflowList.tsx @@ -151,7 +151,7 @@ export class OverflowList extends React.Component, IOver /** A cache containing the widths of all elements being observed to detect growing/shrinking */ private previousWidths = new Map(); - private spacer: Element | null = null; + private spacer: HTMLElement | null = null; public componentDidMount() { this.repartition(false); @@ -255,7 +255,7 @@ export class OverflowList extends React.Component, IOver overflow: [], visible: this.props.items, })); - } else if (this.spacer.getBoundingClientRect().width < 0.9) { + } else if (this.spacer.offsetWidth < 0.9) { // spacer has flex-shrink and width 1px so if it's much smaller then we know to shrink this.setState(state => { if (state.visible.length <= this.props.minVisibleItems!) {