mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
Make id used in EditableItemList unique, namespace mx_EditableItemList_*
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
d774d96290
commit
89ece266c6
3 changed files with 5 additions and 4 deletions
|
@ -88,6 +88,7 @@ export class EditableItem extends React.Component {
|
|||
|
||||
export default class EditableItemList extends React.Component {
|
||||
static propTypes = {
|
||||
id: PropTypes.string.isRequired,
|
||||
items: PropTypes.arrayOf(PropTypes.string).isRequired,
|
||||
itemsLabel: PropTypes.string,
|
||||
noItemsLabel: PropTypes.string,
|
||||
|
@ -121,10 +122,8 @@ export default class EditableItemList extends React.Component {
|
|||
return (
|
||||
<form onSubmit={this._onItemAdded} autoComplete={false}
|
||||
noValidate={true} className="mx_EditableItemList_newItem">
|
||||
<Field id="newAddress" label={this.props.placeholder}
|
||||
type="text" autoComplete="off" value={this.props.newItem || ""}
|
||||
onChange={this._onNewItemChanged}
|
||||
/>
|
||||
<Field id={`mx_EditableItemList_${this.props.id}`} label={this.props.placeholder} type="text"
|
||||
autoComplete="off" value={this.props.newItem || ""} onChange={this._onNewItemChanged} />
|
||||
<AccessibleButton onClick={this._onItemAdded} kind="primary">
|
||||
{_t("Add")}
|
||||
</AccessibleButton>
|
||||
|
|
|
@ -234,6 +234,7 @@ export default class AliasSettings extends React.Component {
|
|||
<div className='mx_AliasSettings'>
|
||||
{canonicalAliasSection}
|
||||
<EditableItemList
|
||||
id="newRoomAlias"
|
||||
className={"mx_RoomSettings_localAliases"}
|
||||
items={this.state.domainToAliases[localDomain] || []}
|
||||
newItem={this.state.newAlias}
|
||||
|
|
|
@ -103,6 +103,7 @@ export default class RelatedGroupSettings extends React.Component {
|
|||
const EditableItemList = sdk.getComponent('elements.EditableItemList');
|
||||
return <div>
|
||||
<EditableItemList
|
||||
id="newRelatedGroup"
|
||||
items={this.state.newGroupsList}
|
||||
className={"mx_RelatedGroupSettings"}
|
||||
newItem={this.state.newGroupId}
|
||||
|
|
Loading…
Reference in a new issue