Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typeahead): don't show hint if there is no active option #2198

Closed
wants to merge 1 commit into from
Closed

fix(typeahead): don't show hint if there is no active option #2198

wants to merge 1 commit into from

Conversation

pkozlowski-opensource
Copy link
Member

Fixes #2185

Copy link
Member

@maxokorokov maxokorokov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -313,7 +313,7 @@ export class NgbTypeahead implements ControlValueAccessor,
}

private _showHint() {
if (this.showHint && this._inputValueBackup != null) {
if (this.showHint && this._windowRef.instance.hasActive() && this._inputValueBackup != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively !!this._windowRef.instance.getActive() directly

@@ -79,6 +79,8 @@ export class NgbTypeaheadWindow implements OnInit {

@Output('activeChange') activeChangeEvent = new EventEmitter();

hasActive() { return this.activeIdx > -1 && this.activeIdx < this.results.length; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternatively !!this.getActive()

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

Successfully merging this pull request may close these issues.

None yet

2 participants