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

  1. Navigate to a page with autocomplete, for example /admin/structure/views/add
  2. Enable network rule with a high latency to ensure that the ajax request takes longer than 400ms
  3. 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

Comments

lauriii created an issue. See original summary.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

larowlan’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative

Is? this still an issue lauriii

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

lauriii’s picture

Status: Postponed (maintainer needs more info) » Active
StatusFileSize
new182.48 KB

This issue still exists:

The code for this can be found from Drupal.behaviors.claroAutoCompete (yes, there's a typo in that property name 😅).

alextars’s picture

StatusFileSize
new1.63 KB

This displays throbber on autocompletesearch event and removes it on autocomplete response.

alextars’s picture

Status: Active » Needs review

Please review.

smustgrave’s picture

Status: Needs review » Needs work

Seems to have a build issue.

Also can we write a test for this? Not tagging as I'm not 100% it's possible.

akram khan’s picture

StatusFileSize
new1.7 KB

added 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 .

akram khan’s picture

Status: Needs work » Needs review
pradipmodh13’s picture

Applied Patch #12.
It is working fine.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Going to mark this but won't be surprised if committer says it needs tests. Just not sure what those tests would be.

  • lauriii committed 40a02eb7 on 10.1.x
    Issue #3167437 by Akram Khan, alextars: Autocomplete field throbber...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Discussed 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!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.