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

add loading state class to input #105

Open
ofrias opened this issue Jul 12, 2023 · 2 comments
Open

add loading state class to input #105

ofrias opened this issue Jul 12, 2023 · 2 comments

Comments

@ofrias
Copy link

ofrias commented Jul 12, 2023

It would be useful to add a "loading" state class to the autocomplete input that could be used to add for example a background spinner to indicate that the autocomplete is loading data. This can be done easily with this code in the startFetch function:

            input.classList.add('ac-loading');  // new code
            settings.fetch(inputText, function (elements) {
                if (fetchCounter === savedFetchCounter && elements) {
                    input.classList.remove('ac-loading');  // new code

Then it can be used with CSS code like this:

.ac-loading {
  background-image: url('path to spinner image');
  background-size: 25px 25px;
  background-position: right 10px center;
  background-repeat: no-repeat;
}
prigaux added a commit to UnivParis1/autocomplete that referenced this issue Jan 8, 2024
From denis-taran#105 but stop loading if no result
prigaux added a commit to UnivParis1/autocomplete that referenced this issue Jan 9, 2024
From denis-taran#105 but stop loading if no result
prigaux added a commit to UnivParis1/autocomplete that referenced this issue Jan 15, 2024
From denis-taran#105 but stop loading if no result
Copy link

stale bot commented Jan 21, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 21, 2025
@frederikhors
Copy link

Please no stale bot.

@stale stale bot closed this as completed Jan 31, 2025
@denis-taran denis-taran reopened this Jan 31, 2025
@stale stale bot removed the wontfix label Jan 31, 2025
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