Problem/Motivation
In Claro, the autocomplete field throbber is showed based on a fixed timeout currently set at 400ms. This doesn't correspond to the actual length of the ajax request, which could lead into either loading animation not being visible when the autocomplete widget is still waiting for the ajax response, or the loading animation being visible when the autocomplete widget already got a response.
Steps to reproduce
- Navigate to a page with autocomplete, for example /admin/structure/views/add
- Enable network rule with a high latency to ensure that the ajax request takes longer than 400ms
- Confirm that the throbber is not visible after 400ms, even though the ajax request isn't complete
Proposed resolution
Make the autocomplete field throbber and loading text correspond to the ajax request length.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | Screen Recording 2023-04-13 at 11.47.00 AM.mov | 1.98 MB | pradipmodh13 |
| #12 | 3167437-12.patch | 1.7 KB | akram khan |
| #9 | 3167437.patch | 1.63 KB | alextars |
Comments
Comment #5
larowlanIs? this still an issue lauriii
Comment #8
lauriiiThis issue still exists:
The code for this can be found from
Drupal.behaviors.claroAutoCompete(yes, there's a typo in that property name 😅).Comment #9
alextarsThis displays throbber on
autocompletesearchevent and removes it on autocomplete response.Comment #10
alextarsPlease review.
Comment #11
smustgrave commentedSeems to have a build issue.
Also can we write a test for this? Not tagging as I'm not 100% it's possible.
Comment #12
akram khanadded updated patch fixed prettier and object-shorthand CCF of #9. sorry for not adding interdiff facing issue with create interdiiff file it create empty interdiff and give interdiff: Whitespace damage detected in input .
Comment #13
akram khanComment #14
pradipmodh13 commentedApplied Patch #12.
It is working fine.
Comment #15
smustgrave commentedGoing to mark this but won't be surprised if committer says it needs tests. Just not sure what those tests would be.
Comment #17
lauriiiDiscussed with @ckrina and @nod_ and agreed that this doesn't need test coverage since this is addressing a UI related bug which doesn't prevent the functionality from working. If anyone is interested in working on test coverage for this, it could be done in a follow-up issue.
Committed 40a02eb and pushed to 10.1.x. Thanks!