question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NgbTypeahead: No event emitted on ESC or onBlur?

See original GitHub issue

Hi guys,

I glanced at the typeahead.ts source code and it seems there is no event emitted when user press Esc key (or clicked outside of the component).

I need this event emitted so that I know that the user cancelled the operation. Then I can display a default text instead / propagate the event to parent component.

Should I go ahead and hack on the source code and add the event? or is this feature already available and I am not seeing it?

The reason I am asking this is because my angular/typescript/javascript skill is minimal… I am sure I will do more harm than good if I ever attempted to ‘contribute’.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
pkozlowski-opensourcecommented, Jan 13, 2017

There are no specific events emmited today when typeahead is dismissed. This could be a feature request to explore (but before implementing anything we should check if this is really needed as users could simply listen to the esc events on their side).

Marking as a feature request.

3reactions
mezzacommented, Feb 28, 2017

+1 This would be great. I have a scenario where a user is editing an existing record, and want to restore the value of the typeahead input to the previous value when they abort selection of a new value

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular Ngbtypeahead Doesn't Reset Value Of ... - ADocLib
An event emitted when the close button is clicked. It has no payload and only relevant for dismissible alerts. 8.0.0. property dismissible. Disable...
Read more >
Angular ngbTypeahead doesn't reset value of input on blur
I'm using the bootstrap ngbTypeahead of Angular2+ and I want to clean the input when lose focus and no item ware selected.
Read more >
ng-bootstrap/ng-bootstrap/ng-bootstrap.metadata.json - UNPKG
... btn-link ngb-dp-arrow-btn\" (click)=\"navigate.emit(navigation. ... title=\"Select month\"\n (change)=\"changeMonth($event.target.value)\">\n <option ...
Read more >
@ng-bootstrap/ng-bootstrap | Yarn - Package Manager
The closed event is emitted after the 'fade out' animation is finished. ... typeahead: resubscribe for value changes on blur, esc, enter (47797d3), ......
Read more >
@ng-bootstrap/ng-bootstrap@14.0.0 - jsDocs.io
An event emitted when the collapsing animation is finished on the panel, ... Has no effect if the panel is already collapsed or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found