Skip to content

Commit

Permalink
#152 | Disable auto complete for input field
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-null committed Mar 16, 2023
1 parent b56a0c0 commit 5651c40
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/options/controllers/LauncherController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ module SitecoreExtensions.Options {
label: 'Enabled'
}
},
{
key: 'autocomplete',
type: 'checkbox',
defaultValue: false,
templateOptions: {
label: 'Autocomplete (autofill)'
}
},
this.buildHeader('<h3>Recent commands:</h3>', 'col-lg-12'),
{
key: "storageType",
Expand Down
2 changes: 1 addition & 1 deletion app/sc_ext/modules/launcher/LauncherModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace SitecoreExtensions.Modules.Launcher {
injectlauncherHtml(): void {
var modal = HTMLHelpers.createElement<HTMLDivElement>('div', { class: 'launcher-modal', id: 'sc-ext-modal' });
var div = HTMLHelpers.createElement<HTMLDivElement>('div', { class: 'launcher-modal-content' });
var input = HTMLHelpers.createElement<HTMLInputElement>('input', { class: 'search-field', id: 'sc-ext-searchBox' });
var input = HTMLHelpers.createElement<HTMLInputElement>('input', { class: 'search-field', id: 'sc-ext-searchBox', autocomplete: this.options.autocomplete ? "on" : "off" });

var ul = HTMLHelpers.createElement<HTMLUListElement>('ul', { class: 'term-list hidden', id: 'sc-ext-searchResults' });
input.onkeyup = (e) => this.inputKeyUpEvent(e);
Expand Down
2 changes: 2 additions & 0 deletions app/sc_ext/modules/launcher/models/LauncherOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ namespace SitecoreExtensions.Modules.Launcher.Models {

searchResultsCount: number = 8;
storageType: StorageType = StorageType.LocalStorage;
autocomplete: boolean = false;
constructor(wrapper: any) {
super();
if (wrapper != null) {
this.enabled = wrapper.model.enabled;
this.autocomplete = wrapper.model.autocomplete;
this.keyBindings.show = wrapper.model.keyBindings.show;
this.keyBindings.hide = wrapper.model.keyBindings.hide;
this.keyBindings.selectNextResult = wrapper.model.keyBindings.selectNextResult;
Expand Down

0 comments on commit 5651c40

Please sign in to comment.