Skip to content

Commit

Permalink
fix(ribbon): add optional chaining to prevent potential errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jikkai committed Jan 26, 2025
1 parent 50f67cd commit ba6a2a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ui/src/views/components/ribbon/Ribbon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function Ribbon(props: IRibbonProps) {
for (const { el, key } of toolbarItems) {
if (!el) continue;

totalWidth += el.getBoundingClientRect().width + 8;
totalWidth += el?.getBoundingClientRect().width + 8;
if (totalWidth > toolbarWidth - 32 - 8 * (allGroups.length - 1)) {
collapsedIds.push(key);
}
Expand Down

0 comments on commit ba6a2a1

Please sign in to comment.