From eb539537f2d1bc75022a6d496f220fc8202b0e9b Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Mon, 9 Mar 2020 16:31:07 +0100 Subject: [PATCH] add recommendations for alt aliases --- src/components/views/elements/EditableItemList.js | 3 ++- src/components/views/elements/Field.js | 5 ++++- src/components/views/room_settings/AliasSettings.js | 6 ++++++ src/i18n/strings/en_EN.json | 3 +++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/views/elements/EditableItemList.js b/src/components/views/elements/EditableItemList.js index c74fd6a4ee..3eb30c808c 100644 --- a/src/components/views/elements/EditableItemList.js +++ b/src/components/views/elements/EditableItemList.js @@ -123,7 +123,8 @@ export default class EditableItemList extends React.Component {
+ autoComplete="off" value={this.props.newItem || ""} onChange={this._onNewItemChanged} + list={this.props.suggestionsListId} /> {_t("Add")} diff --git a/src/components/views/elements/Field.js b/src/components/views/elements/Field.js index 7d5ccbb72d..8583c91a01 100644 --- a/src/components/views/elements/Field.js +++ b/src/components/views/elements/Field.js @@ -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 ). Defaults to "text". type: PropTypes.string, + // id of a element for suggestions + list: PropTypes.string, // The field's label string. label: PropTypes.string, // The field's placeholder string. Defaults to the label. @@ -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"; @@ -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); diff --git a/src/components/views/room_settings/AliasSettings.js b/src/components/views/room_settings/AliasSettings.js index 7c766e3e31..aa6e6069aa 100644 --- a/src/components/views/room_settings/AliasSettings.js +++ b/src/components/views/room_settings/AliasSettings.js @@ -332,6 +332,11 @@ export default class AliasSettings extends React.Component {
{canonicalAliasSection} {localAliasesList} + + {this._getLocalNonAltAliases().map(alias => { + return