Skip to content
This repository has been archived by the owner on Dec 30, 2018. It is now read-only.

Returning false in event handlers does not work #24

Open
himanshuranavat opened this issue Sep 1, 2015 · 0 comments
Open

Returning false in event handlers does not work #24

himanshuranavat opened this issue Sep 1, 2015 · 0 comments

Comments

@himanshuranavat
Copy link

$scope.autocompleteConfig = {
        options: {
            minLength: 1,
            source: [{'label': 'French', 'value':'fr', alternateValueForDisplay: 'FR'}]
        }, 
       events: {
           select: function(event, ui) {
             angular.element(event.target).val(ui.item.alternateValueForDisplay);
             return false;
           }
     }
    };

Returning false is necessary to override the default behavior of "select" event handler of jQuery autocomplete plugin. But, this false return value cannot be read by jQuery due to the way events are bound by this directive (since these events are intercepted by the directive)

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

No branches or pull requests

1 participant