mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 22:14:58 +08:00
Generate unique IDs for SettingsCheckbox
Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
parent
f44622b3d8
commit
b139c8d01c
@ -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…
Reference in New Issue
Block a user