Skip to content

Commit fa629f2

Browse files
committed
add error for over 120 buttons
1 parent dcd451e commit fa629f2

File tree

1 file changed

+6
-0
lines changed
  • packages/shared-ux/button_toolbar/src/toolbar

1 file changed

+6
-0
lines changed

packages/shared-ux/button_toolbar/src/toolbar/toolbar.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ export interface Props {
3737
export const Toolbar = ({ children }: Props) => {
3838
const { primaryButton, iconButtonGroup, extraButtons = [] } = children;
3939

40+
if (extraButtons.length > 120) {
41+
throw new Error(
42+
'There are over 120 extra buttons. Please consider limiting the number of buttons.'
43+
);
44+
}
45+
4046
const extra = extraButtons.map((button, index) =>
4147
button ? (
4248
<EuiFlexItem grow={false} key={`button-${index}`}>

0 commit comments

Comments
 (0)