From 8f225440f64c38227f42afeb1023a68ea197f0d8 Mon Sep 17 00:00:00 2001 From: Kamal Khatwani Date: Sat, 19 Aug 2017 19:26:15 +0530 Subject: [PATCH] #18: Bug fix on presence on immediateParentForm --- bower.json | 2 +- demo/client/lib/js/materializecss-autocomplete.js | 15 ++++++++++----- .../lib/js/materializecss-autocomplete.min.js | 8 ++++---- .../lib/js/materializecss-autocomplete.min.js.map | 2 +- dist/js/materializecss-autocomplete.js | 15 ++++++++++----- dist/js/materializecss-autocomplete.min.js | 8 ++++---- dist/js/materializecss-autocomplete.min.js.map | 2 +- npm-shrinkwrap.json | 2 +- package.json | 2 +- src/js/autocomplete.controller.js | 13 +++++++++---- 10 files changed, 42 insertions(+), 27 deletions(-) diff --git a/bower.json b/bower.json index d2234822..599aea09 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "materializecss-autocomplete", - "version": "1.0.12", + "version": "1.0.13", "description": "angularjs autocomplete", "main": [ "dist/js/materializecss-autocomplete.min.js", diff --git a/demo/client/lib/js/materializecss-autocomplete.js b/demo/client/lib/js/materializecss-autocomplete.js index 47bad835..68955718 100644 --- a/demo/client/lib/js/materializecss-autocomplete.js +++ b/demo/client/lib/js/materializecss-autocomplete.js @@ -1,4 +1,4 @@ -/* materializecss-autocomplete - v1.0.12 - 2017-08-18 */(function () { +/* materializecss-autocomplete - v1.0.13 - 2017-08-19 */(function () { 'use strict'; angular.module('material.autocomplete', ['material.autocomplete.templates']) .run(['$templateCache', '$compile', '$rootScope', function ($templateCache, $compile, $rootScope) { @@ -147,6 +147,7 @@ angular.module('material.autocomplete.templates', []).run(['$templateCache', fun $timeout(function () { self.parentForm = $scope.parentForm; + self.immediateParentForm = $scope.immediateParentForm; }, 20); @@ -335,13 +336,17 @@ angular.module('material.autocomplete.templates', []).run(['$templateCache', fun } if(self.checkError()) { self.parentForm.$setValidity('selection', false); - self.immediateParentForm.$setValidity('selection', false); - self.immediateParentForm[self.inputFieldName].$setValidity('selection', false); + if(self.immediateParentForm) { + self.immediateParentForm.$setValidity('selection', false); + self.immediateParentForm[self.inputFieldName].$setValidity('selection', false); + } } else { self.parentForm.$setValidity('selection', true); - self.immediateParentForm.$setValidity('selection', true); - self.immediateParentForm[self.inputFieldName].$setValidity('selection', true); + if(self.immediateParentForm) { + self.immediateParentForm.$setValidity('selection', true); + self.immediateParentForm[self.inputFieldName].$setValidity('selection', true); + } } }; diff --git a/demo/client/lib/js/materializecss-autocomplete.min.js b/demo/client/lib/js/materializecss-autocomplete.min.js index efcce1dc..a5ed7134 100644 --- a/demo/client/lib/js/materializecss-autocomplete.min.js +++ b/demo/client/lib/js/materializecss-autocomplete.min.js @@ -1,4 +1,4 @@ -/* materializecss-autocomplete - v1.0.12 - 2017-08-18 */ +/* materializecss-autocomplete - v1.0.13 - 2017-08-19 */ !function() { "use strict"; angular.module("material.autocomplete", [ "material.autocomplete.templates" ]).run([ "$templateCache", "$compile", "$rootScope", function(a, b, c) { @@ -142,7 +142,7 @@ } var x = this; d(function() { - x.parentForm = a.parentForm; + x.parentForm = a.parentForm, x.immediateParentForm = a.immediateParentForm; }, 20); var y = { COMMA: 188, @@ -188,8 +188,8 @@ }, x.blur = function(a) { x.isInputFocus = !1, x.isInputBlur = !0, angular.isFunction(x.onBlurCb) && x.onBlurCb(), x.removePlaceHolder(), A = !1, z || (x.hidden = i()), x.checkError() ? (x.parentForm.$setValidity("selection", !1), - x.immediateParentForm.$setValidity("selection", !1), x.immediateParentForm[x.inputFieldName].$setValidity("selection", !1)) : (x.parentForm.$setValidity("selection", !0), - x.immediateParentForm.$setValidity("selection", !0), x.immediateParentForm[x.inputFieldName].$setValidity("selection", !0)); + x.immediateParentForm && (x.immediateParentForm.$setValidity("selection", !1), x.immediateParentForm[x.inputFieldName].$setValidity("selection", !1))) : (x.parentForm.$setValidity("selection", !0), + x.immediateParentForm && (x.immediateParentForm.$setValidity("selection", !0), x.immediateParentForm[x.inputFieldName].$setValidity("selection", !0))); }, x.selectItem = function(a) { x.searchText = a[x.displayProperty1], x.selectedItem = a, x.hidden = i(); }, x.onListEnter = function() { diff --git a/demo/client/lib/js/materializecss-autocomplete.min.js.map b/demo/client/lib/js/materializecss-autocomplete.min.js.map index d4dc8e25..b8a6e714 100644 --- a/demo/client/lib/js/materializecss-autocomplete.min.js.map +++ b/demo/client/lib/js/materializecss-autocomplete.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["materializecss-autocomplete.js"],"names":["angular","module","run","$templateCache","$compile","$rootScope","get","put","MaterialAutocomplete","$timeout","restrict","scope","require","bindToController","id","inputName","showInputName","placeHolder","selectedItem","searchText","displayProperty1","displayProperty2","displayProperty3","displaySubProperty1","displaySubProperty2","displaySubProperty3","displayColor","displayPicture","uniqueDisplayProperty","itemList","remoteMethod","itemChange","disableInput","onBlurCb","onFocusCb","minlength","required","selectionErrorMessage","errorColor","successColor","disableCrossIcon","replace","controller","controllerAs","templateUrl","link","element","attrs","formCtrl","parentForm","$$parentForm","$name","immediateParentForm","$apply","directive","MaterialAutocompleteCntrl","$scope","$element","$q","clearValue","clearSelectedItem","setInputClearButton","self","$setDirty","input","blur","value","handleSearchText","focus","configureWatchers","$watch","bind","selectedItemChange","shouldHide","isSearchable","loading","hasSelection","hasFocus","previousSearchText","index","setLoading","hidden","fetchResults","previousSelectedItem","announceItemChange","isFunction","getAngularElements","elements","obj","key","hasOwnProperty","updateScroll","li","height","offsetHeight","top","bot","hgt","scroller","clientHeight","scrollTop","scrollTo","offset","onResultsRetrieved","matches","handleResults","items","$parent","$eval","isList","isArray","isPromise","then","when","handleQuery","handleUniqueResult","results","res","flag","i","length","push","convertArrayToObject","array","temp","forEach","text","this","KEY_CODE","COMMA","SEMICOLON","ENTER","ESCAPE","SPACE","PAGE_UP","PAGE_DOWN","END","HOME","LEFT_ARROW","UP_ARROW","RIGHT_ARROW","DOWN_ARROW","TAB","BACKSPACE","DELETE","noBlur","isInputFocus","isInputBlur","clearButton","isDisabled","isRequired","hasNotFound","init","find","scrollContainer","querySelector","label","getElementsByTagName","$","setInputName","displayProperty","setPlaceHolder","setAttribute","removePlaceHolder","undefined","removeAttribute","classList","remove","err","$event","checkError","$setValidity","inputFieldName","selectItem","item","onListEnter","onListLeave","onMouseup","keydown","event","keyCode","stopPropagation","preventDefault","Math","min","max","setTextStyle","color","setInputBorderStyle","border-bottom-color","box-shadow","checkSuccess","isFormSubmitted","$submitted"],"mappings":";CAAwD;IACpD;IACAA,QAAQC,OAAO,2BAA0B,qCACpCC,MAAK,kBAAkB,YAAY,cAAc,SAAUC,GAAgBC,GAAUC;QAElFD,EADoBD,EAAeG,IAAI,iBACfD;;KAIpCL,QAAQC,OAAO,uCAAuCC,MAAK,kBAAkB,SAAUC;IACrF;IACAA,EAAeI,IAAI,gBACjB;MAwEJ;IACI;IACA,IAAIC,IAAuB,SAAUC;QACjC;YACIC,UAAU;YACVC;YACAC,WAAU;YACVC;gBACIC,IAAI;gBACJC,WAAW;gBACXC,eAAe;gBACfC,aAAa;gBACbC,cAAc;gBACdC,YAAY;gBACZC,kBAAkB;gBAClBC,kBAAkB;gBAClBC,kBAAkB;gBAClBC,qBAAqB;gBACrBC,qBAAqB;gBACrBC,qBAAqB;gBACrBC,cAAc;gBACdC,gBAAgB;gBAChBC,uBAAuB;gBACvBC,UAAU;gBACVC,cAAc;gBACdC,YAAY;gBACZC,cAAc;gBACdC,UAAU;gBACVC,WAAW;gBACXC,WAAW;gBACXC,UAAU;gBACVC,uBAAuB;gBACvBC,YAAY;gBACZC,cAAc;gBACdC,kBAAkB;;YAEtBC,UAAS;YACTC,YAAY;YACZC,cAAc;YACdC,aAAa;YACbC,MAAM,SAAUlC,GAAOmC,GAASC,GAAOC;gBACnCvC,EAAS;oBACLE,EAAMsC,aAAaD,EAAS,IACxBA,EAAS,MAAMA,EAAS,GAAGE,aAAaC,UACxCxC,EAAMyC,sBAAsBJ,EAAS;oBACrCrC,EAAMsC,aAAaD,EAAS,GAAGE,eAEnCvC,EAAM0C;mBACP;;;;IAKfr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AAK5C,iBAAiB4C,EAAK9B;WAO3D8B,EAAK4G,aAAa;YACd,IAAIsB,KAAkB;YAItB,OAHIlI,EAAKb,cAAkC,SAApBa,EAAKb,eACxB+I,IAAkBlI,EAAKb,WAAWgJ,aAE/BnI,EAAK1B,aAAa0B,EAAK9B,iBAAiB8B,EAAK5C,iBAAiB4C,EAAKqF,eAAe6C;;;IAKjGhM,QAAQC,OAAO,yBACVyC,WAAW,+BACR,UACA,YACA,MACA,YACAa","file":"materializecss-autocomplete.min.js"} \ No newline at end of file +{"version":3,"sources":["materializecss-autocomplete.js"],"names":["angular","module","run","$templateCache","$compile","$rootScope","get","put","MaterialAutocomplete","$timeout","restrict","scope","require","bindToController","id","inputName","showInputName","placeHolder","selectedItem","searchText","displayProperty1","displayProperty2","displayProperty3","displaySubProperty1","displaySubProperty2","displaySubProperty3","displayColor","displayPicture","uniqueDisplayProperty","itemList","remoteMethod","itemChange","disableInput","onBlurCb","onFocusCb","minlength","required","selectionErrorMessage","errorColor","successColor","disableCrossIcon","replace","controller","controllerAs","templateUrl","link","element","attrs","formCtrl","parentForm","$$parentForm","$name","immediateParentForm","$apply","directive","MaterialAutocompleteCntrl","$scope","$element","$q","clearValue","clearSelectedItem","setInputClearButton","self","$setDirty","input","blur","value","handleSearchText","focus","configureWatchers","$watch","bind","selectedItemChange","shouldHide","isSearchable","loading","hasSelection","hasFocus","previousSearchText","index","setLoading","hidden","fetchResults","previousSelectedItem","announceItemChange","isFunction","getAngularElements","elements","obj","key","hasOwnProperty","updateScroll","li","height","offsetHeight","top","bot","hgt","scroller","clientHeight","scrollTop","scrollTo","offset","onResultsRetrieved","matches","handleResults","items","$parent","$eval","isList","isArray","isPromise","then","when","handleQuery","handleUniqueResult","results","res","flag","i","length","push","convertArrayToObject","array","temp","forEach","text","this","KEY_CODE","COMMA","SEMICOLON","ENTER","ESCAPE","SPACE","PAGE_UP","PAGE_DOWN","END","HOME","LEFT_ARROW","UP_ARROW","RIGHT_ARROW","DOWN_ARROW","TAB","BACKSPACE","DELETE","noBlur","isInputFocus","isInputBlur","clearButton","isDisabled","isRequired","hasNotFound","init","find","scrollContainer","querySelector","label","getElementsByTagName","$","setInputName","displayProperty","setPlaceHolder","setAttribute","removePlaceHolder","undefined","removeAttribute","classList","remove","err","$event","checkError","$setValidity","inputFieldName","selectItem","item","onListEnter","onListLeave","onMouseup","keydown","event","keyCode","stopPropagation","preventDefault","Math","min","max","setTextStyle","color","setInputBorderStyle","border-bottom-color","box-shadow","checkSuccess","isFormSubmitted","$submitted"],"mappings":";CAAwD;IACpD;IACAA,QAAQC,OAAO,2BAA0B,qCACpCC,MAAK,kBAAkB,YAAY,cAAc,SAAUC,GAAgBC,GAAUC;QAElFD,EADoBD,EAAeG,IAAI,iBACfD;;KAIpCL,QAAQC,OAAO,uCAAuCC,MAAK,kBAAkB,SAAUC;IACrF;IACAA,EAAeI,IAAI,gBACjB;MAwEJ;IACI;IACA,IAAIC,IAAuB,SAAUC;QACjC;YACIC,UAAU;YACVC;YACAC,WAAU;YACVC;gBACIC,IAAI;gBACJC,WAAW;gBACXC,eAAe;gBACfC,aAAa;gBACbC,cAAc;gBACdC,YAAY;gBACZC,kBAAkB;gBAClBC,kBAAkB;gBAClBC,kBAAkB;gBAClBC,qBAAqB;gBACrBC,qBAAqB;gBACrBC,qBAAqB;gBACrBC,cAAc;gBACdC,gBAAgB;gBAChBC,uBAAuB;gBACvBC,UAAU;gBACVC,cAAc;gBACdC,YAAY;gBACZC,cAAc;gBACdC,UAAU;gBACVC,WAAW;gBACXC,WAAW;gBACXC,UAAU;gBACVC,uBAAuB;gBACvBC,YAAY;gBACZC,cAAc;gBACdC,kBAAkB;;YAEtBC,UAAS;YACTC,YAAY;YACZC,cAAc;YACdC,aAAa;YACbC,MAAM,SAAUlC,GAAOmC,GAASC,GAAOC;gBACnCvC,EAAS;oBACLE,EAAMsC,aAAaD,EAAS,IACxBA,EAAS,MAAMA,EAAS,GAAGE,aAAaC,UACxCxC,EAAMyC,sB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AASA;;WAQrB7H,EAAK8H,sBAAsB,SAAUD;YACjC;gBACIE,uBAAuBF;gBACvBG,cAAc,eAAeH;;WAQrC7H,EAAKiI,eAAe;YAChB,OAAOjI,EAAKoF,gBAAgBpF,EAAK5C,iBAAiB4C,EAAK9B;WAO3D8B,EAAK4G,aAAa;YACd,IAAIsB,KAAkB;YAItB,OAHIlI,EAAKb,cAAkC,SAApBa,EAAKb,eACxB+I,IAAkBlI,EAAKb,WAAWgJ,aAE/BnI,EAAK1B,aAAa0B,EAAK9B,iBAAiB8B,EAAK5C,iBAAiB4C,EAAKqF,eAAe6C;;;IAKjGhM,QAAQC,OAAO,yBACVyC,WAAW,+BACR,UACA,YACA,MACA,YACAa","file":"materializecss-autocomplete.min.js"} \ No newline at end of file diff --git a/dist/js/materializecss-autocomplete.js b/dist/js/materializecss-autocomplete.js index 47bad835..68955718 100644 --- a/dist/js/materializecss-autocomplete.js +++ b/dist/js/materializecss-autocomplete.js @@ -1,4 +1,4 @@ -/* materializecss-autocomplete - v1.0.12 - 2017-08-18 */(function () { +/* materializecss-autocomplete - v1.0.13 - 2017-08-19 */(function () { 'use strict'; angular.module('material.autocomplete', ['material.autocomplete.templates']) .run(['$templateCache', '$compile', '$rootScope', function ($templateCache, $compile, $rootScope) { @@ -147,6 +147,7 @@ angular.module('material.autocomplete.templates', []).run(['$templateCache', fun $timeout(function () { self.parentForm = $scope.parentForm; + self.immediateParentForm = $scope.immediateParentForm; }, 20); @@ -335,13 +336,17 @@ angular.module('material.autocomplete.templates', []).run(['$templateCache', fun } if(self.checkError()) { self.parentForm.$setValidity('selection', false); - self.immediateParentForm.$setValidity('selection', false); - self.immediateParentForm[self.inputFieldName].$setValidity('selection', false); + if(self.immediateParentForm) { + self.immediateParentForm.$setValidity('selection', false); + self.immediateParentForm[self.inputFieldName].$setValidity('selection', false); + } } else { self.parentForm.$setValidity('selection', true); - self.immediateParentForm.$setValidity('selection', true); - self.immediateParentForm[self.inputFieldName].$setValidity('selection', true); + if(self.immediateParentForm) { + self.immediateParentForm.$setValidity('selection', true); + self.immediateParentForm[self.inputFieldName].$setValidity('selection', true); + } } }; diff --git a/dist/js/materializecss-autocomplete.min.js b/dist/js/materializecss-autocomplete.min.js index 9e8e4cb2..8e53701e 100644 --- a/dist/js/materializecss-autocomplete.min.js +++ b/dist/js/materializecss-autocomplete.min.js @@ -1,4 +1,4 @@ -/* materializecss-autocomplete - v1.0.12 - 2017-08-18 */ +/* materializecss-autocomplete - v1.0.13 - 2017-08-19 */ !function() { "use strict"; angular.module("material.autocomplete", [ "material.autocomplete.templates" ]).run([ "$templateCache", "$compile", "$rootScope", function(a, b, c) { @@ -142,7 +142,7 @@ } var x = this; d(function() { - x.parentForm = a.parentForm; + x.parentForm = a.parentForm, x.immediateParentForm = a.immediateParentForm; }, 20); var y = { COMMA: 188, @@ -188,8 +188,8 @@ }, x.blur = function(a) { x.isInputFocus = !1, x.isInputBlur = !0, angular.isFunction(x.onBlurCb) && x.onBlurCb(), x.removePlaceHolder(), A = !1, z || (x.hidden = i()), x.checkError() ? (x.parentForm.$setValidity("selection", !1), - x.immediateParentForm.$setValidity("selection", !1), x.immediateParentForm[x.inputFieldName].$setValidity("selection", !1)) : (x.parentForm.$setValidity("selection", !0), - x.immediateParentForm.$setValidity("selection", !0), x.immediateParentForm[x.inputFieldName].$setValidity("selection", !0)); + x.immediateParentForm && (x.immediateParentForm.$setValidity("selection", !1), x.immediateParentForm[x.inputFieldName].$setValidity("selection", !1))) : (x.parentForm.$setValidity("selection", !0), + x.immediateParentForm && (x.immediateParentForm.$setValidity("selection", !0), x.immediateParentForm[x.inputFieldName].$setValidity("selection", !0))); }, x.selectItem = function(a) { x.searchText = a[x.displayProperty1], x.selectedItem = a, x.hidden = i(); }, x.onListEnter = function() { diff --git a/dist/js/materializecss-autocomplete.min.js.map b/dist/js/materializecss-autocomplete.min.js.map index d4dc8e25..b8a6e714 100644 --- a/dist/js/materializecss-autocomplete.min.js.map +++ b/dist/js/materializecss-autocomplete.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["materializecss-autocomplete.js"],"names":["angular","module","run","$templateCache","$compile","$rootScope","get","put","MaterialAutocomplete","$timeout","restrict","scope","require","bindToController","id","inputName","showInputName","placeHolder","selectedItem","searchText","displayProperty1","displayProperty2","displayProperty3","displaySubProperty1","displaySubProperty2","displaySubProperty3","displayColor","displayPicture","uniqueDisplayProperty","itemList","remoteMethod","itemChange","disableInput","onBlurCb","onFocusCb","minlength","required","selectionErrorMessage","errorColor","successColor","disableCrossIcon","replace","controller","controllerAs","templateUrl","link","element","attrs","formCtrl","parentForm","$$parentForm","$name","immediateParentForm","$apply","directive","MaterialAutocompleteCntrl","$scope","$element","$q","clearValue","clearSelectedItem","setInputClearButton","self","$setDirty","input","blur","value","handleSearchText","focus","configureWatchers","$watch","bind","selectedItemChange","shouldHide","isSearchable","loading","hasSelection","hasFocus","previousSearchText","index","setLoading","hidden","fetchResults","previousSelectedItem","announceItemChange","isFunction","getAngularElements","elements","obj","key","hasOwnProperty","updateScroll","li","height","offsetHeight","top","bot","hgt","scroller","clientHeight","scrollTop","scrollTo","offset","onResultsRetrieved","matches","handleResults","items","$parent","$eval","isList","isArray","isPromise","then","when","handleQuery","handleUniqueResult","results","res","flag","i","length","push","convertArrayToObject","array","temp","forEach","text","this","KEY_CODE","COMMA","SEMICOLON","ENTER","ESCAPE","SPACE","PAGE_UP","PAGE_DOWN","END","HOME","LEFT_ARROW","UP_ARROW","RIGHT_ARROW","DOWN_ARROW","TAB","BACKSPACE","DELETE","noBlur","isInputFocus","isInputBlur","clearButton","isDisabled","isRequired","hasNotFound","init","find","scrollContainer","querySelector","label","getElementsByTagName","$","setInputName","displayProperty","setPlaceHolder","setAttribute","removePlaceHolder","undefined","removeAttribute","classList","remove","err","$event","checkError","$setValidity","inputFieldName","selectItem","item","onListEnter","onListLeave","onMouseup","keydown","event","keyCode","stopPropagation","preventDefault","Math","min","max","setTextStyle","color","setInputBorderStyle","border-bottom-color","box-shadow","chec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F,eAAe6C;;;IAKjGhM,QAAQC,OAAO,yBACVyC,WAAW,+BACR,UACA,YACA,MACA,YACAa","file":"materializecss-autocomplete.min.js"} \ No newline at end of file +{"version":3,"sources":["materializecss-autocomplete.js"],"names":["angular","module","run","$templateCache","$compile","$rootScope","get","put","MaterialAutocomplete","$timeout","restrict","scope","require","bindToController","id","inputName","showInputName","placeHolder","selectedItem","searchText","displayProperty1","displayProperty2","displayProperty3","displaySubProperty1","displaySubProperty2","displaySubProperty3","displayColor","displayPicture","uniqueDisplayProperty","itemList","remoteMethod","itemChange","disableInput","onBlurCb","onFocusCb","minlength","required","selectionErrorMessage","errorColor","successColor","disableCrossIcon","replace","controller","controllerAs","templateUrl","link","element","attrs","formCtrl","parentForm","$$parentForm","$name","immediateParentForm","$apply","directive","MaterialAutocompleteCntrl","$scope","$element","$q","clearValue","clearSelectedItem","setInputClearButton","self","$setDirty","input","blur","value","handleSearchText","focus","configureWatchers","$watch","bind","selectedItemChange","shouldHide","isSearchable","loading","hasSelection","hasFocus","previousSearchText","index","setLoading","hidden","fetchResults","previousSelectedItem","announceItemChange","isFunction","getAngularElements","elements","obj","key","hasOwnProperty","updateScroll","li","height","offsetHeight","top","bot","hgt","scroller","clientHeight","scrollTop","scrollTo","offset","onResultsRetrieved","matches","handleResults","items","$parent","$eval","isList","isArray","isPromise","then","when","handleQuery","handleUniqueResult","results","res","flag","i","length","push","convertArrayToObject","array","temp","forEach","text","this","KEY_CODE","COMMA","SEMICOLON","ENTER","ESCAPE","SPACE","PAGE_UP","PAGE_DOWN","END","HOME","LEFT_ARROW","UP_ARROW","RIGHT_ARROW","DOWN_ARROW","TAB","BACKSPACE","DELETE","noBlur","isInputFocus","isInputBlur","clearButton","isDisabled","isRequired","hasNotFound","init","find","scrollContainer","querySelector","label","getElementsByTagName","$","setInputName","displayProperty","setPlaceHolder","setAttribute","removePlaceHolder","undefined","removeAttribute","classList","remove","err","$event","checkError","$setValidity","inputFieldName","selectItem","item","onListEnter","onListLeave","onMouseup","keydown","event","keyCode","stopPropagation","preventDefault","Math","min","max","setTextStyle","color","setInputBorderStyle","border-bottom-color","box-shadow","checkSuccess","isFormSubmitted","$submitted"],"mappings":";CAAwD;IACpD;IACAA,QAAQC,OAAO,2BAA0B,qCACpCC,MAAK,kBAAkB,YAAY,cAAc,SAAUC,GAAgBC,GAAUC;QAElFD,EADoBD,EAAeG,IAAI,iBACfD;;KAIpCL,QAAQC,OAAO,uCAAuCC,MAAK,kBAAkB,SAAUC;IACrF;IACAA,EAAeI,IAAI,gBACjB;MAwEJ;IACI;IACA,IAAIC,IAAuB,SAAUC;QACjC;YACIC,UAAU;YACVC;YACAC,WAAU;YACVC;gBACIC,IAAI;gBACJC,WAAW;gBACXC,eAAe;gBACfC,aAAa;gBACbC,cAAc;gBACdC,YAAY;gBACZC,kBAAkB;gBAClBC,kBAAkB;gBAClBC,kBAAkB;gBAClBC,qBAAqB;gBACrBC,qBAAqB;gBACrBC,qBAAqB;gBACrBC,cAAc;gBACdC,gBAAgB;gBAChBC,uBAAuB;gBACvBC,UAAU;gBACVC,cAAc;gBACdC,YAAY;gBACZC,cAAc;gBACdC,UAAU;gBACVC,WAAW;gBACXC,WAAW;gBACXC,UAAU;gBACVC,uBAAuB;gBACvBC,YAAY;gBACZC,cAAc;gBACdC,kBAAkB;;YAEtBC,UAAS;YACTC,YAAY;YACZC,cAAc;YACdC,aAAa;YACbC,MAAM,SAAUlC,GAAOmC,GAASC,GAAOC;gBACnCvC,EAAS;oBACLE,EAAMsC,aAAaD,EAAS,IACxBA,EAAS,MAAMA,EAAS,GAAGE,aAAaC,UACxCxC,EAAMyC,sBAAsBJ,EAAS;oBACrCrC,EAAMsC,aAAaD,EAAS,GAAGE,eAEnCvC,EAAM0C;mBACP;;;;IAKfrD,QAAQC,OAAO,yBACVqD,UAAU,0BAAyB,YAAY9C;KAGxD;IACI;IAEA,IAAI+C,IAA4B,SAAUC,GAAQC,GAAUC,GAAIjD;QAkH5D,SAASkD;YACLC,K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,OAHIlI,EAAKb,cAAkC,SAApBa,EAAKb,eACxB+I,IAAkBlI,EAAKb,WAAWgJ,aAE/BnI,EAAK1B,aAAa0B,EAAK9B,iBAAiB8B,EAAK5C,iBAAiB4C,EAAKqF,eAAe6C;;;IAKjGhM,QAAQC,OAAO,yBACVyC,WAAW,+BACR,UACA,YACA,MACA,YACAa","file":"materializecss-autocomplete.min.js"} \ No newline at end of file diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index f3c726e6..8eb2d682 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "materializecss-autocomplete", - "version": "1.0.11", + "version": "1.0.13", "dependencies": { "abbrev": { "version": "1.1.0", diff --git a/package.json b/package.json index b0c6989b..c7c4ae8a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "materializecss-autocomplete", - "version": "1.0.12", + "version": "1.0.13", "description": "angularjs autocomplete", "main": "dist/js/materializecss-autocomplete.min.js", "style": "dist/css/materializecss-autocomplete.min.css", diff --git a/src/js/autocomplete.controller.js b/src/js/autocomplete.controller.js index 4fa41bcf..d9d9dbf6 100644 --- a/src/js/autocomplete.controller.js +++ b/src/js/autocomplete.controller.js @@ -6,6 +6,7 @@ $timeout(function () { self.parentForm = $scope.parentForm; + self.immediateParentForm = $scope.immediateParentForm; }, 20); @@ -194,13 +195,17 @@ } if(self.checkError()) { self.parentForm.$setValidity('selection', false); - self.immediateParentForm.$setValidity('selection', false); - self.immediateParentForm[self.inputFieldName].$setValidity('selection', false); + if(self.immediateParentForm) { + self.immediateParentForm.$setValidity('selection', false); + self.immediateParentForm[self.inputFieldName].$setValidity('selection', false); + } } else { self.parentForm.$setValidity('selection', true); - self.immediateParentForm.$setValidity('selection', true); - self.immediateParentForm[self.inputFieldName].$setValidity('selection', true); + if(self.immediateParentForm) { + self.immediateParentForm.$setValidity('selection', true); + self.immediateParentForm[self.inputFieldName].$setValidity('selection', true); + } } };