Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Typeahead is-open change via document click does not trigger digest on original scope #5467

Closed
trogowski opened this issue Feb 12, 2016 · 9 comments

Comments

@trogowski
Copy link

When typeahead's drop-down is open, clicking outside of it closes the drop-down but variable bound to is-open does not change to false. Here's a minimal test case.

Changing 'scope.$digest()' to 'originalScope.$digest()' here seems to fix the problem.

@icfantv
Copy link
Contributor

icfantv commented Feb 12, 2016

This looks like a good catch. @wesleycho, thoughts?

@mkozhukharenko
Copy link

I've encountered the same problem +1

@mkozhukharenko
Copy link

Found temporary workaround:

<input type="text" click-outside="typeaheadIsOpen = false;" ng-model="model" uib-typeahead="option as option.name for option in new.options | filter:{$:$viewValue}" typeahead-is-open="typeaheadIsOpen">

I used click-outside directive to manipulate typeaheadIsOpen variable;

@azizmaredia20
Copy link

Hi mkozhukharenko,
can you please share your click-outside="typeaheadIsOpen = false;" directive code

@azizmaredia20
Copy link

Does anyone has a fix for this isssue?

@icfantv
Copy link
Contributor

icfantv commented Feb 19, 2016

@azizmaredia20, hi there. Please understand that we are all unpaid volunteers on this team, managing a VERY popular OSS project. It maybe as simple as making the change indicated above, but we would need to make sure it doesn't have any negative side effects. I've flagged it as needing investigation and we will get to it. You will need to be patient.

Barring that, you could always fork the repo and make the change yourself using a custom build until this issue is fixed.

@azizmaredia20
Copy link

@icfantv, Yes sure i will fork the repo and try to solve the issue

@mkozhukharenko
Copy link

@azizmaredia20 I'm using IamAdamJowett/angular-click-outside directive

@wesleycho
Copy link
Contributor

Similar to the recently fixed issue with 313ba83, we should change this to originalScope.

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

Successfully merging a pull request may close this issue.

5 participants