Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Bug: When using bootstrap.ui.typeahead, if you type the exact item, it won't let you select it #20

Open
tyronedougherty opened this issue Nov 22, 2016 · 10 comments

Comments

@tyronedougherty
Copy link

I noticed a bug when using this plugin with the typeahead plugin from bootstrap, it's present in the demo as well.

If you type the exact name of one of the selections, it will not let you add it to the chips, however if you type less than the full exact name, or don't use capital letters where the item in question uses them, it will let you select it.

For example, on the demo typing FaceBook will not let you hit enter and select the choice, but Facebook or typing Face and hitting enter will.

Any idea what is going on here?

@mohbasheer
Copy link
Owner

I'll check and let you know.

Thank you.

On Tue, Nov 22, 2016 at 12:16 PM Tyrone Dougherty notifications@github.com
wrote:

I noticed a bug when using this plugin with the typeahead plugin from
bootstrap, it's present in the demo
http://codepen.io/mohbasheer/pen/JXKLyY as well.

If you type the exact name of one of the selections, it will not let you
add it to the chips, however if you type less than the full exact name, or
don't use capital letters where the item in question uses them, it will let
you select it.

For example, on the demo typing FaceBook will not let you hit enter and
select the choice, but Facebook or typing Face and hitting enter will.

Any idea what is going on here?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#20, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AESlZx728G6-DBGvb0tOboebLyHhYjncks5rAmy2gaJpZM4K4_Yr
.

@tyronedougherty
Copy link
Author

Thanks @mohbasheer, I had a quick look and couldn't figure out precisely why it was occurring. It would be great if you had any further insight into what was going on 😄

@Krishna-Agrawal
Copy link

Krishna-Agrawal commented Jul 6, 2017

@mohbasheer , @tyronedougherty have you figured out the solution?

@tyronedougherty
Copy link
Author

@Krishna-Agrawal unfortunately I wasn't able to find out what was causing the issue, sorry I can't be of more help :(

Let me know if you ever figure it out!

@mohbasheer
Copy link
Owner

mohbasheer commented Jul 6, 2017 via email

@Krishna-Agrawal
Copy link

Krishna-Agrawal commented Jul 6, 2017

Hi @mohbasheer , @tyronedougherty
I found a workaround for this.
While creating input field add typeahead-on-select callback.
<input ng-model-control ng-model="typeaheadmodel" uib-typeahead="company for company in typeahead.availableCompanies | filter:$viewValue" typeahead-on-select="onSelect($item)"></input>
and Add onSelect listener in ngModelControl directive and call render function directly.
Something like this :
scope.onSelect = function (item,model,label,event) { if(ngModelCtrl.$modelValue === item) ngModelCtrl.$render() }

@mohbasheer
Copy link
Owner

mohbasheer commented Jul 6, 2017 via email

@Krishna-Agrawal
Copy link

Thank you @mohbasheer :)

@Krishna-Agrawal
Copy link

Hi @mohbasheer
Could you please look that Pull Request and update the library,

Thanks and Regards
Krishna Agrawal

@mohbasheer
Copy link
Owner

mohbasheer commented Jul 7, 2017 via email

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

3 participants