Skip to content

Commit 91f3534

Browse files
ZainAsif767Zain Asif
and
Zain Asif
authored
Fixed 'No results to show' for both templates (#56)
* fix(tags-input): prevent dropdown from closing on tag selection - Added a flag to decide the default behavior that closes the dropdown on tag selection. - Related to a bug where users had to reopen the dropdown after each selection. * fix(tags-input): fixed for attribute * feat(dropdown): added a no record found message when searching for tags which are not available * refactor(dropdown): refactored the dropdown with requested changes * refactor(dropdown): removed unused styles * fix(dropdown): removed no results to show div from childTemplate * refacto(dropdown): fixed the issue of no results to show for both custom and default template * refactor(dropdown): fixed classes overlapping --------- Co-authored-by: Zain Asif <[email protected]>
1 parent 9c5346f commit 91f3534

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

projects/angular-tags-input/src/lib/dropdown/dropdown.component.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
<ng-container
2-
*ngTemplateOutlet="dropDownTemplate; context: context"
3-
></ng-container>
2+
*ngTemplateOutlet="dropDownTemplate; context: context">
3+
</ng-container>
4+
5+
<ng-container *ngIf="!context.items.length">
6+
<div class="angular-tags-dropdown">
7+
No results to show
8+
</div>
9+
</ng-container>
410

511
<!-- Default Tag Options Template -->
612
<ng-template #defaultTagOptionTemplate let-items="items" let-config="config">
@@ -18,9 +24,6 @@
1824
{{ item[config.displayProperty] }}
1925
</div>
2026
</ng-container>
21-
<ng-container *ngIf="!items.length">
22-
<div>No results to show</div>
23-
</ng-container>
2427
</div>
2528
</div>
2629
</ng-template>

projects/tags-input-demo/src/app/app.component.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,6 @@ <h5 class="main__form__heading">4. Options with image</h5>
463463
</ng-container>
464464
</div>
465465
</div>
466-
<div class="items-list__item" *ngIf="!items.length">
467-
<span>No results to show</span>
468-
</div>
469466
</ng-template>
470467

471468
<ng-template #ddNestedChildrenTemplate let-items="items" let-fns="fns" let-config="config">

0 commit comments

Comments
 (0)