Problem/Motivation

Linkit extends the common pattern of autocomplete with major new functionality.
We think it's important to stay within Drupal core UX expectations to identify the element functionality.

The throbber is missing, making the text field look like a regular text field.

As a comparision, here's the project selection with the "o" indicator right aligned.

Proposed resolution

We should similarly simply add the common "o" indication.

Remaining tasks

User interface changes

Comments

miro_dietiker created an issue. See original summary.

anon’s picture

Are you sure the throbber is missing? Linkit has CSS for this.

.js input.form-linkit-autocomplete {
  background-image: url(../../../core/misc/throbber-inactive.png);
  background-position: 100% center; /* LTR */
  background-repeat: no-repeat;
}

.js[dir="rtl"] input.form-linkit-autocomplete {
  background-position: 0 center;
}

.js input.form-linkit-autocomplete.ui-autocomplete-loading {
  background-image: url(../../../core/misc/throbber-active.gif);
  background-position: 100% center; /* LTR */
}

.js[dir="rtl"] input.form-linkit-autocomplete.ui-autocomplete-loading {
  background-position: 0 center;
}

Would be interesting to know if this can fail, and if, why it fails.

anon’s picture

StatusFileSize
new21.26 KB

See this image from my installation. It is Linkit 8.x-5.x

anon’s picture

This issue were added in the dev branch. Might be the same problem.
#2871331: Throbber icon not found on subdirectory base installations

berdir’s picture

Yes, relying on core files in CSS is not possibly, just copy that over into the module and then use it like that. A bit unfortunate but there is no other reliable way.

anon’s picture

Status: Active » Closed (duplicate)

Then I will consider this as fixed/duplicate as of #2871331: Throbber icon not found on subdirectory base installations.

Should be in 8.x-5.0-beta6

berdir’s picture

Status: Closed (duplicate) » Active

Nope, that issue *introduced* this problem, when you have the module in e.g. /modules/contrib/linkit and not just /modules/linkit, as the last comment/patch in that issue also mentioned.

Neither approach works for both cases, the only thing really is to copy the file and point to that.

anon’s picture

Ah, sorry for this. I misunderstood you.

berdir’s picture

Title: Display an autocomplete indication » Copy autocomplete icon into module as reference to core folder is not reliable
Issue tags: +Novice

No worries, I was not very clear.

Updated the title and tagging as novice, all that needs to be done is copy the file from core into this module and update the CSS.

anon’s picture

Status: Active » Needs review
StatusFileSize
new1.54 KB

How about this? Seems like we can use the core class for autocomplete fields (form-autocomplete).

The only risk I see here is that someone might use a theme where the autocomplete-loading.module.css is not loaded. Is that something we can live with or do we really need to make a copy of the throbber icon and duplicate the css?

berdir’s picture

Issue tags: -Novice

Seems like a nice solution, not tested yet.

I guess if they do leave that out then all autocomplete form elements would be broken. This even seems better in that regard, because it a) gives themes a single way to style all autocomplete elements and b) it's at least as likely if not more that themes skip all module CSS files I'd say.

So, +1 from me.

anon’s picture

Great! Thanks for input.

I would appreciate if you could test the patch, and give me feedback. Then I will commit this right away.

berdir’s picture

Status: Needs review » Reviewed & tested by the community

Works nicely for both wysiwyg integration and the not yet committed link field integration, yay form elements :)

anon’s picture

Status: Reviewed & tested by the community » Needs work

Runned the tests and we have some Javascript errors now.

Turnes out that if we add the "form-autocomplete" class, the default Drupal autocomplete script will kick in, which is not desirable for us.

anon’s picture

Status: Needs work » Needs review
StatusFileSize
new3.34 KB

Seems like the only solution is the one that have already been discussed, to copy the image files into the module.

Status: Needs review » Needs work

The last submitted patch, 15: copy_autocomplete_icon-2902873-15.patch, failed testing. View results

anon’s picture

I don't manage to create a patch with the new image files in it that will work in the testbot.

mbovan’s picture

Status: Needs work » Needs review
StatusFileSize
new3.37 KB

A try to create a patch with images.

anon’s picture

@mbovan: Seems to work with the test bot. Please let me know how you created the patch file.

mbovan’s picture

I used git diff --binary option.

It looks like your patch was missing "new file mode" part: https://www.diffchecker.com/aEanzIxQ

berdir’s picture

Status: Needs review » Reviewed & tested by the community

The autocomplete.js change seems a bit unrelated but otherwise this seems OK.

acbramley’s picture

Status: Reviewed & tested by the community » Needs work

Applying the patch from #18 with patch -p1 or git apply doesn't actually add the images in.

acbramley’s picture

Status: Needs work » Reviewed & tested by the community

Tested again and git apply seemed to work, not too sure why it didn't the first time. Sorry!

  • anon committed 23f310a on 8.x-5.x
    Issue #2902873 by anon, mbovan, Berdir: Copy autocomplete icon into...
anon’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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