Commit e1dad848 by Torkel Ödegaard Committed by GitHub

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

Propagate event to onChange prop in Switch component
parents f7a1e4c1 628c5c1d
...@@ -14,8 +14,7 @@ export interface Props { ...@@ -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> { ...@@ -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() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment