Commit 0b5c536d authored by Evren Kutar's avatar Evren Kutar

ADD fixes GH-70 focus to first input with validation error

parent d4607e1d
...@@ -294,6 +294,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap']) ...@@ -294,6 +294,12 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
if (scope[workOnForm].$valid) { if (scope[workOnForm].$valid) {
generator.submit(scope, redirectTo); generator.submit(scope, redirectTo);
scope.$broadcast('disposeModal'); scope.$broadcast('disposeModal');
} else {
// focus to first input with validation error
$timeout(function () {
var firsterror = angular.element(document.querySelectorAll('input.ng-invalid'))[0]
firsterror.focus();
});
} }
} }
} }
...@@ -1016,7 +1022,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap']) ...@@ -1016,7 +1022,10 @@ angular.module('ulakbus.formService', ['ui.bootstrap'])
"query": $scope.form_params.query "query": $scope.form_params.query
}; };
* ``` * ```
* ### Special response object process *
* Special response object process
* -------------------------------
*
* - If response object is a downloadable pdf file, checking from headers `headers('content-type') === * - If response object is a downloadable pdf file, checking from headers `headers('content-type') ===
* "application/pdf"` download using Blob object. * "application/pdf"` download using Blob object.
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment