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): incoming data are not filtered after typeahead kicks-in #3728

Merged

Conversation

IraErshova
Copy link
Contributor

@IraErshova IraErshova commented Feb 8, 2018

Fix filtering incoming data after typeahead kicks-in. Remove filtering functionality from demo code to ngx-bootstrap component's code.

Close #3725

PR Checklist

Before creating new PR, please take a look at checklist below to make sure that you've done everything that needs to be done before we can merge it.

  • read and followed the CONTRIBUTING.md guide.
  • built and tested the changes locally.
  • added/updated tests.
  • added/updated API documentation.
  • added/updated demos.

@IraErshova IraErshova force-pushed the fix-typeahead-async-filter branch 2 times, most recently from af2e229 to 1552274 Compare February 8, 2018 13:11
@codecov
Copy link

codecov bot commented Feb 8, 2018

Codecov Report

Merging #3728 into development will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##           development    #3728   +/-   ##
============================================
  Coverage        52.52%   52.52%           
============================================
  Files                3        3           
  Lines               99       99           
  Branches            17       17           
============================================
  Hits                52       52           
  Misses              37       37           
  Partials            10       10

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0664d8f...9ae90e6. Read the comment docs.

.mergeMap((value: string) => {
const normalizedQuery = this.normalizeQuery(value);

return this.typeahead.map((data: any[]) => {

This comment was marked as off-topic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

typeahead has type any in the whole module. Adding type for this instance should be a separate issue.

@@ -344,7 +344,15 @@ export class TypeaheadDirective implements OnInit, OnDestroy {
this._subscriptions.push(
this.keyUpEventEmitter
.debounceTime(this.typeaheadWaitMs)
.mergeMap(() => this.typeahead)
.mergeMap((value: string) => {

This comment was marked as off-topic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

value: string is not typing for typeahead. This code is correct and doesn't break anything

daniloff200
daniloff200 previously approved these changes Jan 20, 2020
@dmitry-zhemchugov
Copy link
Contributor

Tested. Issues were fixed by @IraErshova . Ready to merge

@valorkin
Copy link
Member

@dmitry-zhemchugov has to be tested with real XHR as a source of data

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.

fix(typeahead): incoming data are not filtered after typeahead kicks-in
5 participants