auto-complete icon indicating copy to clipboard operation
auto-complete copied to clipboard

How to disable "No result Found"?

Open swapsword opened this issue 7 years ago • 8 comments

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 avatar Apr 12 '17 10:04 swapsword

@swapsword thanks for reporting this. You can achieve this by overriding css.

allenhwkim avatar Apr 12 '17 13:04 allenhwkim

    <style>
      ngui-auto-complete .no-match-found {display: none};
    </style>

allenhwkim avatar Apr 14 '17 23:04 allenhwkim

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

allenhwkim avatar Apr 15 '17 20:04 allenhwkim

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>

Scott-Atkinson avatar Apr 27 '17 04:04 Scott-Atkinson

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.

antoinebeland avatar Oct 26 '17 19:10 antoinebeland

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.

krishna139 avatar Feb 20 '18 04:02 krishna139

.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;
  }
}

nguyendt214 avatar Mar 26 '18 09:03 nguyendt214

2px line on ul :c

tobertigor avatar Sep 04 '19 08:09 tobertigor