I have a set of disabled input fields with one enabled input field at the top. Check out the Plunker here
Here's a quick summary:
When you focus on the "Name this group" input field, the first disabled input field will become enabled with an active class.
What I'm trying to achieve is that if there is no value in the "Name this group" field and it loses focus, it should revert back to its original state. This means the first child input will go back to being disabled and the active class will be removed again.
Any assistance in making this happen would be greatly appreciated.
Below is a snippet of my code:
$scope.focusGroup = function(i) {
$scope.csTagGrp[i].csTags[0].active = true;
};
$scope.focusItem = function(i, parent_i) {
$scope.csTagGrp[parent_i].csTags[i].old = true;
if ($scope.csTagGrp[parent_i].csTags[i + 1]) {
$scope.csTagGrp[parent_i].csTags[i + 1].active = true;
} else if ($scope.csTagGrp[parent_i + 1]) {
$scope.csTagGrp[parent_i + 1].csTags[0].active = true;
}
};