浏览代码

Merge pull request #15109 from grafana/fix/explore-switches

Propagate event to onChange prop in Switch component
Torkel Ödegaard 7 年之前
父节点
当前提交
e1dad8488b
共有 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 {
 export interface State {
   id: any;
   id: any;
 }
 }
-
-export class Switch extends PureComponent<Props, State> {
+ export class Switch extends PureComponent<Props, State> {
   state = {
   state = {
     id: _.uniqueId(),
     id: _.uniqueId(),
   };
   };
@@ -23,7 +22,7 @@ export class Switch extends PureComponent<Props, State> {
   internalOnChange = (event: React.FormEvent<HTMLInputElement>) => {
   internalOnChange = (event: React.FormEvent<HTMLInputElement>) => {
     event.stopPropagation();
     event.stopPropagation();
 
 
-    this.props.onChange();
+    this.props.onChange(event);
   };
   };
 
 
   render() {
   render() {