mgcrea / angular-strap

AngularJS 1.2+ native directives for Bootstrap 3.
mgcrea.github.io/angular-strap
MIT License
5.73k stars 1.38k forks source link

Couldn't type angular brackets inside input box #2246

Closed hatimn02 closed 5 years ago

hatimn02 commented 7 years ago

If i use bs-options in input field then i am unable to type angular brackets < >

<input type="text" class="form-control" bs-options="key for key in ctrl.keySuggestions" 
bs-typeahead ng-model="item.name">

Try typing <hello> If you copy paste the text it will work fine but if you try to type then it won't work

http://plnkr.co/edit/9EGvXm07FPiEAeyCn8uf?p=preview

DaleWebb commented 7 years ago

I don't believe anyone is actively fixing bugs at the moment.

If you are able to dig into the code and find a solution, we'd be happy to receive a PR on it 👍

mkannwischer commented 7 years ago

This is due to var value = selected ? selected.toString().replace(/<(?:.|\n)*?>/gm, '') : ''; https://github.com/mgcrea/angular-strap/blob/c09125d414186ba0a93c035591d1cfe43310e66b/src/typeahead/typeahead.js#L335 which was introduced in https://github.com/mgcrea/angular-strap/commit/6efd25f3930c292508d43543726fe9c0418e8cda to fix https://github.com/mgcrea/angular-strap/issues/547

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.