Move stopPropagation to wrapper, fix #1470 again

This commit is contained in:
afc163 2016-06-07 16:27:55 +08:00
parent 57ab8dfdfe
commit 5cc87ede0b
2 changed files with 15 additions and 8 deletions

View File

@ -49,6 +49,7 @@ const rowSelection = {
},
};
ReactDOM.render(<Table rowSelection={rowSelection} columns={columns} dataSource={data} />
ReactDOM.render(
<Table rowSelection={rowSelection} columns={columns} dataSource={data} />
, mountNode);
````

View File

@ -428,10 +428,12 @@ export default class Table extends React.Component {
this.getDefaultSelection().indexOf(rowIndex) >= 0);
}
return (
<Radio disabled={props.disabled} onClick={stopPropagation}
onChange={(e) => this.handleRadioSelect(record, rowIndex, e)}
value={rowIndex} checked={checked}
/>
<span onClick={stopPropagation}>
<Radio disabled={props.disabled}
onChange={(e) => this.handleRadioSelect(record, rowIndex, e)}
value={rowIndex} checked={checked}
/>
</span>
);
}
@ -449,9 +451,13 @@ export default class Table extends React.Component {
props = this.props.rowSelection.getCheckboxProps.call(this, record);
}
return (
<Checkbox checked={checked} disabled={props.disabled} onClick={stopPropagation}
onChange={(e) => this.handleSelect(record, rowIndex, e)}
/>
<span onClick={stopPropagation}>
<Checkbox
checked={checked}
disabled={props.disabled}
onChange={(e) => this.handleSelect(record, rowIndex, e)}
/>
</span>
);
}