Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Blur (On Change) action #125

Open
mhipo1364 opened this issue Jun 22, 2016 · 1 comment
Open

On Blur (On Change) action #125

mhipo1364 opened this issue Jun 22, 2016 · 1 comment

Comments

@mhipo1364
Copy link

Hi guys

Is there any event listener about blur or change action in input?

@milad1367
Copy link

milad1367 commented Jun 14, 2018

add this "onBlur": "&" to scope.
add onBlur to selectResult:

            vm.selectResult = function(result) {
                if (vm.matchClass) {
                    result.title = result.title.toString().replace(/(<([^>]+)>)/ig, '');
                }
                vm.searchStr = vm.lastSearchTerm = result.title;
               // vm.selectedObject = result;
                vm.selectedObject = result.originalObject;
                vm.onBlur({user:result.originalObject});
                vm.searchStr = "";
                vm.showDropdown = false;
                vm.results = [];
                //$scope.$apply();
            }

and this :

<ibd-autocomplete-input id="{{vm.unicId}}"
                           placeholder="{{vm.unicId}}"
                           pause="100"
                           selectedobject="vm.input"
                           localdata="vm.allUsers"
                           searchfields="username"
                           titlefield="username"
                           minlength="1"
                           imagefield="pic"
                           inputclass="form-control form-control-small"
                           on-blur = "vm.addUser(user)"
                           />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants