From 102903a614bb5bd1cc85ca3b04c4ebd0e6f41ad7 Mon Sep 17 00:00:00 2001 From: Jason Rhodes Date: Tue, 26 Feb 2019 12:30:13 -0500 Subject: [PATCH] Fixes button group onChange type issues --- src/components/button/button_group/button_group.js | 2 +- src/components/button/index.d.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/button/button_group/button_group.js b/src/components/button/button_group/button_group.js index 326e09c772aa..24e693010935 100644 --- a/src/components/button/button_group/button_group.js +++ b/src/components/button/button_group/button_group.js @@ -65,7 +65,7 @@ export const EuiButtonGroup = ({ key={index} label={option.label} name={option.name || name} - onChange={onChange.bind(null, option.id, option.value)} + onChange={() => onChange(option.id, option.value)} size={buttonSize} toggleClassName="euiButtonGroup__toggle" type={type} diff --git a/src/components/button/index.d.ts b/src/components/button/index.d.ts index 7368c08f5986..363271ecdac5 100644 --- a/src/components/button/index.d.ts +++ b/src/components/button/index.d.ts @@ -1,4 +1,4 @@ -import { CommonProps } from '../common'; +import { CommonProps, Omit } from '../common'; import { IconType, IconSize } from '../icon' import { ToggleType } from '../toggle' @@ -146,6 +146,6 @@ declare module '@elastic/eui' { } export const EuiButtonGroup: FunctionComponent< - HTMLAttributes & EuiButtonGroupProps + Omit, 'onChange'> & EuiButtonGroupProps >; }