Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to show all results from my json without typing ? #222

Closed
Senpai10 opened this issue May 11, 2021 · 7 comments
Closed

Is it possible to show all results from my json without typing ? #222

Senpai10 opened this issue May 11, 2021 · 7 comments

Comments

@Senpai10
Copy link

Hello,

First of all I thank you for this great library.

I wanted to know if it is possible, when you click on the search bar or a button for example, to display all the results from my JSON in the list without typing a single character.

I am sorry if I am not clear

Have a nice day !

@Senpai10 Senpai10 changed the title Is it possible to show all result from my json without typing ? Is it possible to show all results from my json without typing ? May 11, 2021
@TarekRaafat
Copy link
Owner

Hello @Senpai10,

Thank you, I'm glad that it's useful for you.

Answering your question yes you can by using the below config.

Please try it and let me know if that's what you're trying to achieve or not.

trigger: {
    event: ["input", "focus"],
    condition: () => true,
}

Cheers, and have a nice day too! :)

@Senpai10
Copy link
Author

Thanks you su much ! It works.
I have an another question.

In AutoComplete options, I have: maxResults: 5,. As I said I want to display all my results. So I set this option to 100. But the problem is that if the user's screen is too small, the results are cut off. How to make it responsive ? Or maybe allow a scroll in the displayed results ?

Thanks again for your help and have a nice day !

@folknor
Copy link

folknor commented May 13, 2021

You need to limit the size of the result popup container, by default #autoComplete_list and use the overflow CSS property. https://developer.mozilla.org/en-US/docs/Web/CSS/overflow

@Senpai10
Copy link
Author

Thanks you !

@Senpai10 Senpai10 reopened this Jun 10, 2021
@Senpai10
Copy link
Author

Hello @TarekRaafat ,

I just reopened this issue because I migrated from v8 to v10. The V10 is awesome, thanks you for your work !

But the solution provided last time doesn't work anymore. Do you have an idea how to fix this ?

trigger: { event: ["input", "focus"], condition: () => true, }

Have a nice day !

@TarekRaafat
Copy link
Owner

TarekRaafat commented Jun 10, 2021

Hello @Senpai10,

Thanks, I'm glad you like it!

Here you go, check this code and add to it the same condition code, and let me know how it goes.

Cheers, and have a nice day too! :)

@Senpai10
Copy link
Author

Thanks you ! Working again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants