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

Added reopen-on-click typeahead option (Issue #759) #5428

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kazeno
Copy link

@kazeno kazeno commented Feb 7, 2016

Added code to allow to reopen the typeahead list on click, as per issue #759. This requires adding the "typeahead-reopen-on-click" boolean attribute to the typeahead input, example:
<input type="text" uib-typeahead="obj for obj in objs" typeahead-reopen-on-click="true">

Only works on typeahead-editable="true" since otherwise the view value is erased on blur. The element[0] === evt.target comparison makes sure only the clicked typeahead's list is reopened.

Added code to allow to reopen the typeahead list on click, as per issue angular-ui#759. This requires adding the "typeahead-reopen-on-click" boolean attribute to the typeahead input, example:
<input type="text" uib-typeahead="obj for obj in objs" typeahead-reopen-on-click="true">

Only works on typeahead-editable="true" since otherwise the view value is erased on blur.
prevent modelCtrl.$viewValue.length from returning an error if modelCtrl.$viewValue is undefined
@wesleycho
Copy link
Contributor

This can't be done currently with min-length="0"?

@kazeno
Copy link
Author

kazeno commented Feb 23, 2016

No, min-length only determines how many characters are needed for the typeahead to make a query. Even if it is 0, normally the typeahead list will not reopen until the input text is modified.

@wesleycho
Copy link
Contributor

What about programmatically controlling it with typeahead-is-open?

@kazeno
Copy link
Author

kazeno commented Feb 24, 2016

typeahead-is-open is not bound two-way, changing it programmatically doesn't affect the typeahead

@wesleycho
Copy link
Contributor

My preference would be for a PR implementing that as a two-way bound variable - that would then make any custom programmatic opening/closing possible on the user side.

@kazeno
Copy link
Author

kazeno commented Feb 24, 2016

That seems more complicated to implement, but sounds like a great idea. I'll see if I can make it work.

@AntiAsko
Copy link

AntiAsko commented Apr 5, 2016

Is this on the npm repository? I have the latest version and it doesn't seem to be there

@deeg
Copy link
Contributor

deeg commented Apr 5, 2016

@AntiAsko, this is not currently on npm as it is an open PR which has not been merged.

The PR still needs work before it can be merged. Feel free to take a look through the comments for the proposed changes, and finish up the PR if you have time so that we can get it merged in.

@shyamal890
Copy link

Any progress on this. Much needed!

typeahed-min-length = 0 and typeahead-is-open doesn't work when a user types something like 'a' in the input clicks outside of the element> Dropdown closes > User again clicks on the typeahead input > NO RESULT!

@damianohcm
Copy link

Same here. Would love the typeahead-reopen-on-click

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

Successfully merging this pull request may close these issues.

7 participants