Akryum / vue-mention

Mention component for Vue.js
https://vue-mention.netlify.app/
MIT License
523 stars 54 forks source link

How to hide popup if no results? #51

Open holmesadrianh opened 3 years ago

holmesadrianh commented 3 years ago

There is not need to show "No results" to the user. If there are no results the popup does not need to display. Is there a way to close the menu when there are no results?

arc-arnob commented 2 years ago

Yes that would be very helpful

arc-arnob commented 2 years ago

@holmesadrianh btw did you find any way to do it?

anatolykopyl commented 2 years ago

Old thread, but for anyone in the future looking for a way, you can do it by specifying a named slot #no-result.

<Mentionable
  :keys="['@', '#']"
  :items="items"
  offset="6"
  insert-space
  @open="onOpen"
  @apply="onApply"
>
  <textarea
    v-model="text"
  />

  <template #no-result>
    <div style="display: none;" />
  </template>
</Mentionable>