Generate unique IDs for SettingsCheckbox
Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
parent
f44622b3d8
commit
b139c8d01c
1 changed files with 3 additions and 3 deletions
|
@ -47,16 +47,16 @@ module.exports = React.createClass({
|
|||
if (!label) label = SettingsStore.getDisplayName(this.props.name, this.props.level);
|
||||
else label = _t(label);
|
||||
|
||||
let id = this.props.name;
|
||||
// We generate a relatively complex ID to avoid conflicts
|
||||
const id = this.props.name + "_" + this.props.group + "_" + this.props.value + "_" + this.props.level;
|
||||
let checkbox = (
|
||||
<input id={this.props.name}
|
||||
<input id={id}
|
||||
type="checkbox"
|
||||
defaultChecked={val}
|
||||
onChange={this.onChange}
|
||||
/>
|
||||
);
|
||||
if (this.props.group) {
|
||||
id = this.props.group + '_' + this.props.name;
|
||||
checkbox = (
|
||||
<input id={id}
|
||||
type="radio"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue