auto-complete
auto-complete copied to clipboard
How to disable "No result Found"?
Hello Developers,
How to disable "No result Found" in dropdown?
Problem: I have change the value of "No result found to "empty/space" by setting no-match-found-text to space. However, the dropdown for "No reult Found" is still there if you see closely. How can i disable/hide it completely, when result is not found?
Example: http://plnkr.co/edit/2qDToO?p=preview
Regards, Swapnil
@swapsword thanks for reporting this. You can achieve this by overriding css.
<style>
ngui-auto-complete .no-match-found {display: none};
</style>
I may use this opportunity not to display any when no-match-found-text
is false or blank.
- undefined -> 'No Match Found'
- false -> do not display dropdown
- blank -> do not display dropdown
- any text -> do display as given
Setting the CSS doesn't seem to work
<div auto-complete [source]="arrayOfStrings" (valueChanged)="valueChanged($event)" placeholder="enter text" > <input [ngModel]="model1" /> </div>
<style> auto-complete .no-match-found {display: none !IMPORTANT}; </style>
Also tried what you suggested.
<style> ngui-auto-complete .no-match-found {display: none}; </style>
The CSS solution seems to work only when we specify the keyword deep
before the selector. For example:
/deep/ .no-match-found {
display: none !important;
}
This solution works perfectly for me.
Hi @antoinebeland ,
This solution is not working properly for me. Please can you provide another solution if you know.
Any help will be admire.
Thank you.
.ngui-auto-complete li.no-match-found{
display: none !important;
}
or you can create class cover everything like hide-empty-search
for example
Then
:host /deep/ .hide-empty-search {
.ngui-auto-complete li.no-match-found{
display: none !important;
}
}
2px line on ul :c