Преглед на файлове

Propagate event to onChange prop in Switch component

Dominik Prokop преди 7 години
родител
ревизия
628c5c1da6
променени са 1 файла, в които са добавени 2 реда и са изтрити 3 реда
  1. 2 3
      packages/grafana-ui/src/components/Switch/Switch.tsx

+ 2 - 3
packages/grafana-ui/src/components/Switch/Switch.tsx

@@ -14,8 +14,7 @@ export interface Props {
 export interface State {
   id: any;
 }
-
-export class Switch extends PureComponent<Props, State> {
+ export class Switch extends PureComponent<Props, State> {
   state = {
     id: _.uniqueId(),
   };
@@ -23,7 +22,7 @@ export class Switch extends PureComponent<Props, State> {
   internalOnChange = (event: React.FormEvent<HTMLInputElement>) => {
     event.stopPropagation();
 
-    this.props.onChange();
+    this.props.onChange(event);
   };
 
   render() {