I'm currently developing a dynamic form that generates multiple Divs. My goal is to detect when the focus is lost from an entire div, not just from one input field.
https://i.sstatic.net/YopGs.png
As shown in the image, I have several identical forms and the challenge lies in identifying when a user finishes editing one of the forms.
These forms are dynamically created using an ng-repeat directive.
<fieldset data-ng-repeat="response in responces" ng-init="sectionIndex = $index">
<div id="customFrom">
<input type="text" ng-model="response.code" name="" placeholder="Code">
<input type="text" ng-model="response.rank" name="" placeholder="{{ 'app.forms.responses.rank' | translate }}">
<input type="text" ng-model="response.value" name="" placeholder="{{ 'app.forms.responses.value' | translate }}">
<input type="text" ng-model="response.name" name="" placeholder="{{ 'app.forms.createQuiz.fields.name' | translate }}" class="labelTextQuestionCreation">
<button class="remove" ng-click="removeResponse($index)" ng-show="deteteResponceOption">-</button>
</div>
</fieldset>
What's the best approach to trigger an action when a user switches from one form to another? I need to detect when a form (Div) loses focus in order to execute a specific function. Thank you.