Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Allow editing of alt_aliases according to MSC2432 #4187

Merged
merged 11 commits into from
Mar 10, 2020
4 changes: 4 additions & 0 deletions res/css/views/room_settings/_AliasSettings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ limitations under the License.
outline: none;
box-shadow: none;
}

.mx_AliasSettings summary {
cursor: pointer;
}
5 changes: 3 additions & 2 deletions src/components/views/elements/EditableItemList.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ export default class EditableItemList extends React.Component {
<form onSubmit={this._onItemAdded} autoComplete="off"
noValidate={true} className="mx_EditableItemList_newItem">
<Field id={`mx_EditableItemList_new_${this.props.id}`} label={this.props.placeholder} type="text"
autoComplete="off" value={this.props.newItem || ""} onChange={this._onNewItemChanged} />
<AccessibleButton onClick={this._onItemAdded} kind="primary">
autoComplete="off" value={this.props.newItem || ""} onChange={this._onNewItemChanged}
list={this.props.suggestionsListId} />
<AccessibleButton onClick={this._onItemAdded} kind="primary" type="submit">
{_t("Add")}
</AccessibleButton>
</form>
Expand Down
5 changes: 4 additions & 1 deletion src/components/views/elements/Field.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export default class Field extends React.PureComponent {
element: PropTypes.oneOf(["input", "select", "textarea"]),
// The field's type (when used as an <input>). Defaults to "text".
type: PropTypes.string,
// id of a <datalist> element for suggestions
list: PropTypes.string,
// The field's label string.
label: PropTypes.string,
// The field's placeholder string. Defaults to the label.
Expand Down Expand Up @@ -157,7 +159,7 @@ export default class Field extends React.PureComponent {
render() {
const {
element, prefix, postfix, className, onValidate, children,
tooltipContent, flagInvalid, tooltipClassName, ...inputProps} = this.props;
tooltipContent, flagInvalid, tooltipClassName, list, ...inputProps} = this.props;

const inputElement = element || "input";

Expand All @@ -169,6 +171,7 @@ export default class Field extends React.PureComponent {
inputProps.onFocus = this.onFocus;
inputProps.onChange = this.onChange;
inputProps.onBlur = this.onBlur;
inputProps.list = list;

const fieldInput = React.createElement(inputElement, inputProps, children);

Expand Down
Loading