Problem/Motivation

Follow up to Issue #3116377
When autocomplete fields have long labels (or the viewport is just narrow), the loading text overlaps the label
Screenshot of loading text in an autocomplete field overlapping the field's label

Proposed resolution

?

Remaining tasks

Add screenshots
Review code
Commit

User interface changes

todo

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#42 Screenshot-of-autocomplete-working-as-expected.png52.34 KBniranjan_panem
#38 3199601-issue2-after-patch.mov408.53 KBnayana_mvr
#38 3199601-issue2-before-patch.mov324.65 KBnayana_mvr
#38 3199601-issue1-after-patch.png44.71 KBnayana_mvr
#38 3199601-issue1-before-patch.png45.26 KBnayana_mvr
#36 Screenshot 2023-01-30 at 1.26.02 PM.png92.2 KBgauravvvv
#36 3199601-36.patch2.53 KBgauravvvv
#32 Before-patch.gif136.32 KBShubham Sharma 77
#32 After-patch.gif131.21 KBShubham Sharma 77
#31 3199601-after-30.gif49.44 KBjavi-er
#31 3199601-before-30.gif71.77 KBjavi-er
#30 autocomplete-loading-text-overlaps-long-labels-3199601-30.patch4.95 KBmaninders
#29 autocomplete-loading-text-overlaps-long-labels-3199601-29.patch4.96 KBmaninders
#28 autocomplete-loading-text-overlaps-long-labels-3199601-28.patch4.96 KBmaninders
#27 rtl-mobile-longtext--autocomplete-loading-text-overlaps-long-labels-3199601-27.png57.46 KBmaninders
#27 rtl-mobile-shorttext-autocomplete-loading-text-overlaps-long-labels-3199601-27.png41.86 KBmaninders
#27 rtl-desktop-longtext--autocomplete-loading-text-overlaps-long-labels-3199601-27.png65.37 KBmaninders
#27 rtl-desktop-shorttext-autocomplete-loading-text-overlaps-long-labels-3199601-27.png45.72 KBmaninders
#27 mobile-longtext--autocomplete-loading-text-overlaps-long-labels-3199601-27.png56.22 KBmaninders
#27 mobile-shorttext-autocomplete-loading-text-overlaps-long-labels-3199601-27.png52.98 KBmaninders
#27 desktop-longtext--autocomplete-loading-text-overlaps-long-labels-3199601-27.png94.56 KBmaninders
#27 desktop-shorttext-autocomplete-loading-text-overlaps-long-labels-3199601-27.png51.39 KBmaninders
#27 autocomplete-loading-text-overlaps-long-labels-3199601-27.patch4.91 KBmaninders
#25 after-patch.png809.21 KBgayatri chahar
#25 before-patch.png809.96 KBgayatri chahar
#24 interdiff_23-34.txt3.74 KBranjith_kumar_k_u
#24 3199601-24.patch4.9 KBranjith_kumar_k_u
#23 autocomplete-loading-text-overlaps-long-labels-3199601-23.patch4.91 KBmaninders
#23 rtl-mobile-longtext--autocomplete-loading-text-overlaps-long-labels-3199601-23.png57.46 KBmaninders
#23 rtl-mobile-shorttext-autocomplete-loading-text-overlaps-long-labels-3199601-23.png41.86 KBmaninders
#23 rtl-desktop-longtext--autocomplete-loading-text-overlaps-long-labels-3199601-23.png65.37 KBmaninders
#23 rtl-desktop-shorttext-autocomplete-loading-text-overlaps-long-labels-3199601-23.png45.72 KBmaninders
#23 mobile-longtext--autocomplete-loading-text-overlaps-long-labels-3199601-23.png56.22 KBmaninders
#23 mobile-shorttext-autocomplete-loading-text-overlaps-long-labels-3199601-23.png52.98 KBmaninders
#23 desktop-longtext--autocomplete-loading-text-overlaps-long-labels-3199601-23.png94.56 KBmaninders
#23 desktop-shorttext-autocomplete-loading-text-overlaps-long-labels-3199601-23.png51.39 KBmaninders
#18 After Patch 3199601.png550.73 KBchetanbharambe
#18 Before Patch 3199601.png535.23 KBchetanbharambe
#16 3199601.16.patch2.92 KBsakthivel m
#15 3199601.15.patch2.92 KBsakthivel m
#14 3199601-14.patch2.92 KBkapilv
#13 3199601-13.patch2.92 KBkapilv
#12 3199601.12.patch2.92 KBsakthivel m
#11 interdiff.txt629 byteskapilv
#11 3199601-11.patch2.92 KBkapilv
#10 3199601.9.patch2.92 KBsakthivel m
#9 after-3199601-7-tags-field.png25.14 KBakrikawa
#9 after-3199601-7-author-field.png38.96 KBakrikawa
#9 before-3199601-7-tags-field.png24.1 KBakrikawa
#9 before-3199601-7-author-field.png13.86 KBakrikawa
#7 3199601-after_patch.mp43.25 MBabhijith s
#7 3199601-7.patch958 bytesabhijith s
#5 3199601_05_after.png70.01 KBhinal05
#5 3199601_05_before.png72.69 KBhinal05
#4 3199601-4.patch933 bytesdjsagar
#4 before-patch.png22.8 KBdjsagar
#4 after-patch.png20.81 KBdjsagar
#3 autocomplete_with_bg.png25.72 KBvolkerk
#3 autocomplete_half-throbber.gif7.6 KBvolkerk
label-run-into-loading.png13.7 KBjustafish

Comments

justafish created an issue. See original summary.

justafish’s picture

Issue summary: View changes
volkerk’s picture

Issue summary: View changes
StatusFileSize
new7.6 KB
new25.72 KB

Thank you for creating the follow-up, as mentionend in a #3116377: Autocomplete input in views exposed filters does not align with select and text inputs, maybe adding background to .claro-autocomplete__message would be a solution? There is already a throbber replacing the magnifying glass, but only half of it is shown, afaics there is an issue with the svg.

A gif of the current state of the throbber and the loading message overlapping the message:
Animated gif of the current state of the throbber and the loading message overlapping the message.

What adding a background could look like:
Screenshot of what the ovarlapping message could look like when adding a background color.

djsagar’s picture

Status: Active » Needs review
StatusFileSize
new20.81 KB
new22.8 KB
new933 bytes

I created patch regarding above issue please review.

Thanks!

hinal05’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new72.69 KB
new70.01 KB

Applied patch #4 and it's working fine please review the screenshot.

justafish’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for the patch! I think that approach is a bit heavy-handed though as it touches every form label in Claro, not just ones which have a clash with the loading label. Also bear in mind the "Loading" text is customisable so this might still overlap.

abhijith s’s picture

StatusFileSize
new958 bytes
new3.25 MB

Added styling specifically for the autocomplete form element.Please review the patch.

abhijith s’s picture

Status: Needs work » Needs review
akrikawa’s picture

Status: Needs review » Needs work
StatusFileSize
new13.86 KB
new24.1 KB
new38.96 KB
new25.14 KB

Thanks Abhijith S. I applied the patch and took a look at two instances of autocomplete fields on the node edit form.

Content author field

Before:
screenshot of author field before applying patch 3199601-7
After:
screenshot of author field after applying patch 3199601-7

Tags field

Before:
screenshot of tags field before applying patch 3199601-7
After:
screenshot of tags field after applying patch 3199601-7


Your patch works when the field label and the input are the same width, but not when the input's width less than its wrapper (tested this on Chrome on a Mac).

sakthivel m’s picture

Status: Needs work » Needs review
StatusFileSize
new2.92 KB

Hi,

#10 I have provided the patch please verify if it is working or not.

kapilv’s picture

StatusFileSize
new2.92 KB
new629 bytes
sakthivel m’s picture

StatusFileSize
new2.92 KB

#10 Patch Custom Commands Failed

#12 Patch Recreated

kapilv’s picture

StatusFileSize
new2.92 KB
kapilv’s picture

StatusFileSize
new2.92 KB
sakthivel m’s picture

StatusFileSize
new2.92 KB

#15 Patch Recreated, Please verify it

sakthivel m’s picture

StatusFileSize
new2.92 KB

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.

chetanbharambe’s picture

StatusFileSize
new535.23 KB
new550.73 KB

Verified and tested patch #16.
Patch applied successfully and looks good to me.

Testing Steps:
# Goto: node/add/article
# Add some long label instead of Tags
# Search the result
# User is able to see loading text overlapping on long labels

Expected Results:
# User should not see loading text overlapping on long labels (should see loading text inside the box)

Actual Results:
# Currently User is able to see loading text overlapping on long labels

Can be a move to RTBC.

chetanbharambe’s picture

Status: Needs review » Reviewed & tested by the community

Verified and tested patch #16.
Patch applied successfully and looks good to me.

Testing Steps:
# Goto: node/add/article
# Add some long label instead of Tags
# Search the result
# User is able to see loading text overlapping on long labels

Expected Results:
# User should not see loading text overlapping on long labels (should see loading text inside the box)

Actual Results:
# Currently User is able to see loading text overlapping on long labels

Can be a move to RTBC.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 16: 3199601.16.patch, failed testing. View results

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.

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.

ranjith_kumar_k_u’s picture

StatusFileSize
new4.9 KB
new3.74 KB
gayatri chahar’s picture

Status: Needs review » Needs work
StatusFileSize
new809.96 KB
new809.21 KB

I have successfully applied patch #24 on drupal 9.5.x-dev
But its not working for me Adding screenshots for the refrence

maninders’s picture

Hi @gayatri Chahar, Please try with the #23.

maninders’s picture

After PHP 8.1 & MySQL 5.7 Custom Commands Failed in #27 again adding patch.

maninders’s picture

After PHP 8.1 & MySQL 5.7 Custom Commands Failed in #27 again adding patch.

maninders’s picture

After PHP 8.1 & MySQL 5.7 Custom Commands Failed in #27 again adding patch.

javi-er’s picture

StatusFileSize
new71.77 KB
new49.44 KB

Patch at #30 worked well for me on 9.5.x

Before

After

Shubham Sharma 77’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new131.21 KB
new136.32 KB

Applied patch #30 applied successfully in drupal-9.5.x-dev.
Thanks for the patch
For ref sharing gif...

quietone’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update

Thanks everyone for getting a working patch for this problem! There are a few more things to do before this is ready for a committer.

The proposed resolution of the Issue Summary is a question. adding tag for an issue summary update. Write an issue summary for an existing issue has guidance on that.

There are many patches here with a comment asking for a review. It is expected and far more helpful to explain why you made the changes that you made. Also, a diff or interdiff is always expected. There are instructions for creating an interdiff .

@Maninders, before uploading a patch you can run the same checks that are run by the testbot, Have a look at the instructions for running the coding standard checks locally so you can be sure the tests will run before uploading a patch. It also has the advantage of saving resources, including money, for the Drupal association. There are real costs for running the tests.

There has not been a review of the code changes here since #6. This needs a code review.

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.

gauravvvv’s picture

1. Instead of padding-right: calc(7rem - 1px); we can use padding-inline-end which will work in both ltr & rtl direction.

2. .js .form-autocomplete.is-autocompleting {background-position: 100% 75%;} This is outdated.

3. .claro-autocomplete__message styling needs to refactored.

gauravvvv’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new2.53 KB
new92.2 KB

I have attached a patch for same, Updated the issue summary as well.

please review

gauravvvv’s picture

Issue summary: View changes
nayana_mvr’s picture

Verified the patch #37 and tested it on Drupal version 10.1.x. The patch works fine and I have added the before and after screenshots of issue 1 (search icon overlapping) and screen recordings of issue 2 (loading text overlapping field label) for reference.

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

Number of patches here but not a lot of interdiffs. Please upload an interdiff with all your patches.

Confirmed this issue on D10 using this label
"Lorem ipsum dolor sit amet consectetur adipiscing elit, nunc facilisi porta risus quis cubilia ligula"

#33 called for an IS update which still needs to happen.

Proposed solution is still a question and as a UX issue this needs before/after screenshots.

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

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

akashdab’s picture

The second issue of tags overlapping with process icon does not seem to occur anymore. Link

niranjan_panem’s picture

Tested in drupal 11 claro theme, display of autocomplete values are not overlapping with search icon, not able to reproduce the issue. Below is the screen shot of it.

screen shot of autocomplete working as expected.

bnjmnm’s picture

Issue summary: View changes

#42 That's not testing the reported issue which is specific to form labels
The part that was tesed is an out of scope addition that was incorrectly added in #36 and was fixed in a separate issue.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.