From 831bc9eb7d3b2a030aee59135eb632ac4ae302e9 Mon Sep 17 00:00:00 2001 From: Will Abson Date: Thu, 2 Jun 2016 09:23:36 +0100 Subject: [PATCH] Add autocomplete input option on search control Refs #69 --- ng2-components/ng2-alfresco-search/README.md | 1 + .../src/components/alfresco-search-control.component.html | 2 +- .../src/components/alfresco-search-control.component.ts | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ng2-components/ng2-alfresco-search/README.md b/ng2-components/ng2-alfresco-search/README.md index 7fd9d1c200..bada1c4af8 100644 --- a/ng2-components/ng2-alfresco-search/README.md +++ b/ng2-components/ng2-alfresco-search/README.md @@ -166,6 +166,7 @@ bootstrap(SearchDemo, [ **searchTerm**: {string} (optional) default "". Search term to pre-populate the field with
**inputType**: {string} (optional) default "text". Type of the input field to render, e.g. "search" or "text" (default)
**expandable** {boolean} (optional) default true. Whether to use an expanding search control, if false then a regular input is used. +**autocomplete** {boolean} (optional) default true. Whether the browser should offer field auto-completion for the input field to the user. ### Search results diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.html b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.html index 6412fd8994..34c27a1943 100644 --- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.html +++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.html @@ -4,7 +4,7 @@ search
- +
diff --git a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.ts b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.ts index 827fc29ae9..aa32999868 100644 --- a/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.ts +++ b/ng2-components/ng2-alfresco-search/src/components/alfresco-search-control.component.ts @@ -38,6 +38,9 @@ export class AlfrescoSearchControlComponent { @Input() inputType = 'text'; + @Input() + autocomplete: boolean = true; + @Input() expandable: boolean = true; @@ -67,6 +70,10 @@ export class AlfrescoSearchControlComponent { return this.expandable ? ' mdl-textfield__expandable-holder' : ''; } + getAutoComplete(): string { + return this.autocomplete ? 'on' : 'off'; + } + /** * Method called on form submit, i.e. when the user has hit enter *