Claro long select options stop responsive layout

Created on 23 November 2023, about 1 year ago

Problem/Motivation

In Chrome, when editing a node which uses a select and that select has long options, the responsive layout does not work and the right column is hidden in narrower browser widths.

Steps to reproduce

  1. Create a taxonomy list, add a term that will create a select option that is wider then the claro left column. The local example we had as 112 characters long!
  2. Add the taxonomy list to the content type
  3. Create / Edit a new of that content type
  4. Above 976px [the two column layout], Left column width is fixed by the width of the select input. resize the browser to see the right column fall out of the right side of the browser, until the

If I try limiting the select width using the browser console, it does not fix the layout. If I delete the select in the console, it does.

I am not sure how to make the select fluid width as it is in the browser widths < 976px [the single column layout], but this may not be problem with the select, but with the grid?

๐Ÿ› Bug report
Status

Active

Version

10.1 โœจ

Component
Claroย  โ†’

Last updated about 6 hours ago

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom ice70

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @ice70
  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia swatidhurandhar

    I can replicate this issue when select option has very long text, I have provided a patch to fix it.

  • Status changed to Needs work about 1 year ago
  • The Needs Review Queue Bot โ†’ tested this issue.

    While you are making the above changes, we recommend that you convert this patch to a merge request โ†’ . Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)

  • Pipeline finished with Failed
    about 1 year ago
    #56606
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Nitin shrivastava

    @swatidhurandhar I am not able to replicate this issue.
    Can you please provide steps with screenshots?

    Working Fine from my end.

  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia swatidhurandhar

    @Nitin shrivastava Steps are mentioned in the description.
    1) Create a vocabulary and create a taxonomy term in it which is at least 112 characters long.
    2) Add the taxonomy in a content type and change the autocomplete to select list in manage form display.
    3) Now add content in same content type, and now you can see the page is broken due to select list.

    I have opened a MR for fixes.

  • Status changed to Needs work about 1 year ago
  • The Needs Review Queue Bot โ†’ tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide โ†’ to find step-by-step guides for working with issues.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Nitin shrivastava

    @swatidhurandhar Yes, I'm replicating the issue, but I believe this isn't a bug; it falls more into the category of a feature request. The width will adjust based on the character length of the taxonomy name.
    Patch apply successfully.
    Before Patch

    After Patch.

  • Status changed to RTBC about 1 year ago
  • Status changed to Needs work about 1 year ago
  • The Needs Review Queue Bot โ†’ tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

    Consult the Drupal Contributor Guide โ†’ to find step-by-step guides for working with issues.

  • I have checked the above screenshots and tried to replicate the issue. I don't think this is an issue i believe this is the select list default behaviour
    @ice70 Can you share some screenshots where you are facing issues?

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom ice70

    Hi @shweta__sharma

    [with-select.png] shows the default layout with the taxonomy select that has some really long text.
    A gap appears on the left side of the main edit column and the total page width becomes larger than the browser window creating horizontal scrolling. The right side of the page will not be visible from about 1024px, unless the user scrolls to the right shown in [hidden-right-side.png]

    [without-select.png] shows the result of deleting the select object via chrome inspection. Once the select has gone, the two columns flow to the browser width and the page remains in the visible area.

    When the layout collapses to a single column structure, the select changes to variable width and stays within the visible area [mobile.png] - I had a look around to see how this was working but could not see it to replicate on the higher browser widths.

    Thank you for your help.

  • ๐Ÿ‡จ๐Ÿ‡ญSwitzerland saschaeggi Zurich

    This needs work as 34.3rem sounds like a pretty magical number to me

  • ๐Ÿ‡ท๐Ÿ‡ธSerbia alex.87

    alex.87 โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ท๐Ÿ‡ธSerbia alex.87

    Personally, I don't think this is an issue, it is just how the select list works across the browsers.

    But in case I'm wrong I submitted a new MR with a small change. I changed `34.3rem` to 100% as the first one is not working well with the small devices.

  • Pipeline finished with Failed
    12 months ago
    #65821
  • Pipeline finished with Failed
    12 months ago
    #65894
  • Status changed to Needs review 11 months ago
  • ๐Ÿ‡ท๐Ÿ‡ธSerbia alex.87
  • Status changed to Needs work 11 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    MR should be updated for 11.x as the current development branch.

    Issue summary should be updated with proposed solution.+ before/after screenshots in the UI section. Please use full default issue template.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia amietpatial
    • Tested on Screen Resolution Test:1366 X 768
    • OS - windows 11 pro
    • Browser - latest chrome
    • Data characters used 132 and 252.
    • Experiencing the addition of a horizontal scroll at the bottom that is adversely affecting the overall UX.
    • Attached screen recording
  • Added default issue template and updated IS
    Thanks

  • Hi @amietpatial

    As you tested the issue can you please test Merge request !5582? so that we can update the IS

    Thanks

  • Merge request !62913403628: Added max-width to form select. โ†’ (Open) created by alex.87
  • ๐Ÿ‡ท๐Ÿ‡ธSerbia alex.87

    Created MR against 11.x.

  • Pipeline finished with Failed
    11 months ago
    #81474
  • Pipeline finished with Pending
    10 months ago
    #81834
  • Pipeline finished with Failed
    10 months ago
    #81835
  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡ท๐Ÿ‡ธSerbia alex.87

    Please ignore the !5582 and test the !6291. I can't close the !5582 because I was not the original creator of the MR.

    Added Before/After screenshot. Updated summary to match the latest code that is different after pulling the latest 11.x.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Kanchan Bhogade

    Hi
    Tested on
    Drupal version 11.0
    Screen Resolution Test:1366 X 768
    OS - ubuntu
    Browser - latest chrome
    characters- above 150
    Test Result :
    Unable to reproduce the issue, It looks good for D11 without a patch but I observed characters of long text overlapping on the search icon

    Attached screenshot

    Keeping in Needs Review state

  • ๐Ÿ‡ท๐Ÿ‡ธSerbia alex.87

    Kanchan Bhogade please use the testing steps from the IS. Create a new taxonomy, or edit the existing one, create a long term, and add it as a select list to the node, do not use the autocomplete.

  • Status changed to Needs work 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Not sure which MR is to be reviewed. Both seem to have failures though.

  • First commit to issue fork.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia gauravvvv Delhi, India

    Gauravvvv โ†’ changed the visibility of the branch 3403628-claro-long-select to hidden.

  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia gauravvvv Delhi, India

    MR #6291 needs to be reviewed, as it has the latest changes. I have updated the MR, as earlier it was only targeting .form-element--type-select but this is happening on .form-element--type-select-multiple multiple select field as well. please review

  • Pipeline finished with Failed
    10 months ago
    Total: 195s
    #83889
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Sandeep_k New Delhi

    @Gauravvvv, I've tested MR- MR !6291 mergeable on-
    Drupal version -11.0-dev,
    Screen Resolution Test:1366 X 768
    OS - Mac
    Browser - latest chrome
    Characters- above 112,

    Testing Results
    Before the patch, The field width was adjusted based on the character length of the taxonomy name, but the field was aligned with the other field in the form- added before result. I applied the patch as well & after applying the patch- the field size increased (which is not aligned with other fields) and while I re-arranged the fields in the form, some part of the field is also hidden under the Right section of the form- Added after results. Keeping this in Need review.

  • Status changed to Needs work 10 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    MR 6291 appears to have failures.

  • ๐Ÿ‡ท๐Ÿ‡ธSerbia alex.87

    So in https://www.drupal.org/project/drupal/issues/3291549 ๐Ÿ“Œ Refactor Claro's "node form" layout to not use floats Fixed we changed the layout-node-form to use `grid` instead of `float`, and a combination of a grid and long select is causing these issues, still looking for the best solution, but if I use flex instead of the grid all of the issues with nested elements are resolved.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia nayana_mvr

    This issue is not reproducible in Drupal core version 11.x. Tried with single select field and multiple select field. Please find the screenshots attached.

    But I noticed that last few texts are getting trimmed in the list if it is more that the width of the dropdown. I feel atleast some ellipses should be shown to indicate that there are more text.

  • ๐Ÿ‡บ๐Ÿ‡ฆUkraine _tarik_ Lutsk

    I faced with a similar problem. In my case, we are using paragraphs with a select list with really long options. So, the select list visually breaks subforms.
    Changes from comment #15 have limited usage. They can't help if your select list wrapper is less than 60rem(my case).
    I think that we can solve the issue by providing a display grid on the select list wrapper(class .form-type--select) this change limits the select list to the 1fr width, so it won't overflow. However, this fix provides another issue. The display grid forces select lists to use the full width of the grid column. Hence, a small select list(say their options aren't longer than 5 characters) will take all available space. If we apply 'width: fit-content' straight to the select tag it solves an issue with the small select lists but brings back an issue with the overflow.
    I can't recognize a better solution than a display grid for the select lists, but I can't find any CSS trick to apply it only to overflow items.
    So for the moment, I can leave only a small tip for people who are faced with the same problem:

    1. Attach custom CSS library for Claro(if it is used as an administrative theme)
    2. Provide the display grid styles in the custom library for the wrapper for the select list that overflows.

    FYI: The provided solution can trim a text of options. For the moment, it seems like some browsers may have an issue with the text wrapping, so it is better to use libraries for the select list customization.

Production build 0.71.5 2024