mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-01 11:03:18 +03:00
Revert "Hide add button when new item field is empty"
This reverts commit fa99c2e8c5
.
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
a7ca1d0856
commit
7912091bc5
1 changed files with 3 additions and 11 deletions
|
@ -118,23 +118,15 @@ export default class EditableItemList extends React.Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
_renderNewItemField() {
|
_renderNewItemField() {
|
||||||
let addButton;
|
|
||||||
console.log(this.props.newItem);
|
|
||||||
if (this.props.newItem) {
|
|
||||||
addButton = (
|
|
||||||
<AccessibleButton onClick={this._onItemAdded} kind="primary" type="submit">
|
|
||||||
{_t("Add")}
|
|
||||||
</AccessibleButton>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form onSubmit={this._onItemAdded} autoComplete="off"
|
<form onSubmit={this._onItemAdded} autoComplete="off"
|
||||||
noValidate={true} className="mx_EditableItemList_newItem">
|
noValidate={true} className="mx_EditableItemList_newItem">
|
||||||
<Field label={this.props.placeholder} type="text"
|
<Field label={this.props.placeholder} type="text"
|
||||||
autoComplete="off" value={this.props.newItem || ""} onChange={this._onNewItemChanged}
|
autoComplete="off" value={this.props.newItem || ""} onChange={this._onNewItemChanged}
|
||||||
list={this.props.suggestionsListId} />
|
list={this.props.suggestionsListId} />
|
||||||
{ addButton }
|
<AccessibleButton onClick={this._onItemAdded} kind="primary" type="submit">
|
||||||
|
{_t("Add")}
|
||||||
|
</AccessibleButton>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue