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.

Feature request: Dynamic items on chips autocomplete list

See original GitHub issue

Do you want to request a feature or report a bug?

Feature Request

Allow the items to be loaded as result of an async. service request depending on the current user input

What is the expected behavior?

The items displayed on the autocomplete list are loaded from server depending on the user input.

What is the motivation / use case for changing the behavior?

Lets say that I have a list on my backend made of 1000 elements or more, that I want to suggest to the user as possible match for his input. I dont want to load the 1000 elements on component creation, instead, I would like to load sections of it that match his current input.

Other information

For this to work I think It would be required to implement an @Output property for the input/keypress event (that ignores the enter key), that allows a programmer to change the elements given to the td-chips component.

For example:

<td-chips placeholder="Enter something" [(ngModel)]="input" [items]="items$ | async" (onInput)="handleInput($event)" requireMatch></td-chips>

export class SomePresentationComponent {
   items$: Observable<string[]>;
   input : string[];
    constructor(private _service: SomeService){
     this.input = [];
     this.items$ = of([]);
    }

    // Event contains the current value on the input field of the chips element
   handleInput(event: string){
      this.items$ = this._service.getOnDemand(event);
   }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jotatoledocommented, May 30, 2017

nice, considering the added functionalities a minor breaking change as exchange for it sounds fair to me 😃

0reactions
emoralesb05commented, May 26, 2017

https://github.com/Teradata/covalent/pull/626 will take care of this 😄 . There is a minor breaking change (behavior change) 😢 , but its gonna add more flexibility.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autocomplete component - Vuetify
The v-autocomplete component offers simple and flexible ... In this example we add a profile picture for both the chips and list items....
Read more >
Handle change on Autocomplete Component from material ui
For anyone that has a problem with displaying a selected item from the dropdown in the Input field. I found a workaround. Basically,...
Read more >
Chips | Angular Material
Chips allow users to view information, make selections, filter content, and enter data. link Static Chips. Chips are always used inside a container....
Read more >
autocomplete does not stick when scrolling #10079 - GitHub
On using cdkScrollable the dropdown section is sticking to the input, but it is no more contained within the dialog content section. Reproduced ......
Read more >
Chips Autocomplete - StackBlitz
<mat-form-field class="example-chip-list"> · <mat-chip-list #chipList aria-label="Fruit · selection"> · <mat-chip · *ngFor="let fruit of fruits" · [selectable]=" ...
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