From 82f359e73507184aa4c672ace3e5e0af39d7d384 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Tue, 19 Jun 2018 17:10:02 +0100 Subject: [PATCH] Support more input configuration attributes in the input suggestions component. --- .../coffee/components/inputSuggestions.coffee | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/services/web/public/coffee/components/inputSuggestions.coffee b/services/web/public/coffee/components/inputSuggestions.coffee index c5bfbbf933..c9907fe26e 100644 --- a/services/web/public/coffee/components/inputSuggestions.coffee +++ b/services/web/public/coffee/components/inputSuggestions.coffee @@ -12,13 +12,13 @@ define [ ctrl.showHint = false ctrl.hasFocus = false ctrl.suggestion = null + ctrl.onBlur() ctrl.handleKeyDown = ($event) -> if ($event.which == 9 or $event.which == 13) and ctrl.suggestion? and ctrl.suggestion != "" $event.preventDefault() ctrl.localNgModel += ctrl.suggestion - ctrl.suggestion = null - ctrl.showHint = false - + ctrl.suggestion = null + ctrl.showHint = false $scope.$watch "$ctrl.localNgModel", (newVal, oldVal) -> if ctrl.hasFocus and newVal != oldVal ctrl.suggestion = null @@ -34,16 +34,21 @@ define [ App.component "inputSuggestions", { bindings: localNgModel: "=ngModel" + localNgModelOptions: "=?ngModelOptions" getSuggestion: "&" - inputId: "@" - inputPlaceholder: "@" + onBlur: "&?" + inputId: "@?" + inputName: "@?" + inputPlaceholder: "@?" + inputType: "@?" + inputRequired: "=?" controller: inputSuggestionsController template: """
- +
""" }