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.

Add custom content when active

See original GitHub issue

Feature request: yes

What is the expected behavior? It’s possible to set default content when the autocomplete is active. For example, Facebook shows the search history. Content could be:

  1. API Call.
  2. Static content.

Is there any plan to support something like this? It is similar to empty key.

empty: function() {
    return '<div class="not-found"><span>¯\\(ツ)/¯ Sorry, no results found...<span></div>';
}
Snímek obrazovky 2020-07-30 v 17 01 01

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
francoischalifourcommented, Nov 3, 2020

@jelen07 Yes, you can find an example on this sandbox. It happens in the getSources function, where you return sources conditionally based on the query value. Note that this version is still alpha, meaning that’ll we’ll introduce breaking changes to this version and that we won’t provide support for it.

2reactions
Haroenvcommented, Jul 30, 2020

This is possible by returning a source which is valid for empty query in the next version of autocomplete, v1. Documentation for that can be found here: https://autocomplete-experimental.netlify.app/docs/sources#using-dynamic-sources-based-on-query

Read more comments on GitHub >

github_iconTop Results From Across the Web

active - CSS: Cascading Style Sheets - MDN Web Docs
To style links appropriately, put the :active rule after all other link-related rules, as defined by the LVHA-order: :link — :visited ...
Read more >
HOW TO INSTALL CUSTOM CONTENT HOUSES/LOTS (The ...
Hey, boo! I'm showing you how to install cc houses for The Sims 4! The same directions work for Sims downloaded not found...
Read more >
How do you add custom styling to a tab when it's active in ...
Select the bootstrap item you want to override, then make sure you make your own bootstrap class in your style file that loads...
Read more >
How to add active class on click event in custom list group in ...
In Bootstrap 4, Javascript or jQuery events are used to add active class on click event in custom list group. Syntax:.
Read more >
Customize the user interface with HTML templates - Azure AD ...
Learn how to customize the user interface with HTML templates for your applications that use Azure Active Directory B2C.
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