Problem/Motivation

If a node form has any table drag elements, it creates horizontal scroll on the page, for instance when you open the navigation menu.

test

Steps to reproduce

1- Create an entity reference field on a content type.
2- Choose 2 items or more on the "number of values" setting.
3- Visit the form page and open it at 712px width, open the main navigation.

Proposed resolution

Make the width of the input fields to be responsive according to the available horizontal space.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3405576

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

javi-er created an issue. See original summary.

penyaskito made their first commit to this issue’s fork.

penyaskito’s picture

Status: Active » Needs review

Created a merge request with a solution that worked for us. Javi-er thinks this might be a broader issue and not only affecting tabledrag.

smustgrave’s picture

Status: Needs review » Needs work

as UI issue could a screenshot of the issue be added to the issue summary.

ankithashetty’s picture

Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new195.36 KB
new1.19 MB

kostyashupenko made their first commit to this issue’s fork.

ankithashetty’s picture

StatusFileSize
new970.28 KB

+ RTBC.
Tested the MR and it fixed the reported issue. Also IS updated with required SS.

Followed the same steps shared in IS to test it.

After applying the MR:

kostyashupenko’s picture

Version: 10.1.x-dev » 11.x-dev
Issue summary: View changes
StatusFileSize
new32.28 KB
new28.98 KB

First of all, issue target version is 10.1.x, but MR was created against 11.x branch. So switching issue version to 11.x. However bug exist in 10.x and 11.x and since it's a bug report, we can merge it directly in 10.x. I checked - the latest diff in MR can be applied in 10.x with no problem.

About original problem - input type text have size attribute, which potentially can be different, but core has size="60" by default. The width of container of input element is less than this size input produce, that's why when not enough viewport width - input element goes out of viewport. So we need to add 100% width to the input element itself (because currently it doesn't have it, but should have for specific case in table). Also, when we are using autocomplete input fields - those fields have extra wrapper <div class="claro-autocomplete">, which has display: inline-block CSS styles. Which means if we set low size on the input element, like size="10", the entire width of input field will be too narrow (but should be 100%). The fix provided in #4 is added in wrong place. We already have same kind of fix in another place in table.pcss.css file, which works ok for input fields which are not autocomplete input fields. SO i just added one more CSS line to wrap autocomplete cases.

This is result:
test

I think this issue can be easily reviewed & merged

ankithashetty’s picture

Status: Needs review » Needs work
StatusFileSize
new1.69 MB

Update:
The test results shared in #8 are w.r.t to MR in #3. => Works as per expectation.

Tried the #7 MR, but it didn't fix the scroll issue for me.

Changing back to 'Needs work' status.
@kostyashupenko Could you please check again? Hope you have opened the main navigation while testing the fix.
Thanks!

kostyashupenko’s picture

Status: Needs work » Needs review

I found 2 issues:
1. I forgot to put one more CSS line (now fixed)
2. on your video you have enabled aggregration (did you clear cache?). Even with previous commit you should have width: 100% on the .claro-autocomplete CSS selector, but i don't see it in your video.

Anyway let's re-test again, now works even with opened navigation. Sorry )

ankithashetty’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new1.19 MB
new1.23 MB

Thanks for the update!

Tested again with the same steps, here are my observations:
* After applying the latest change, disabled aggregation and cleared cache (multiple times)

case #1. The fix works when we have a single autocomplete field

case #2. If we add another term/item, then we still see the scrolling issue. (Fix in #3 worked in both the scenarios)

Need to check on case 2.
Thanks!

kostyashupenko’s picture

Status: Needs work » Needs review

Fixed for ajax case. Also rebased

shweta__sharma’s picture

StatusFileSize
new723.47 KB

Hi @kostyashupenko
I have tested MR 5643 on Drupal 11 and it's working fine.
The scrolling issue has been fixed when open the navigation menu for both cases.
Attached small recording.
Thanks

shweta__sharma’s picture

Status: Needs review » Reviewed & tested by the community

Moving to RTBC

ankithashetty’s picture

Issue summary: View changes
StatusFileSize
new650.49 KB

Thanks again @kostyashupenko!

+1 to RTBC

Steps to reproduce (shared in IS)
1- Create an entity reference field on a content type.
2- Choose 2 items or more on the "number of values" setting.
3- Visit the form page and open it at 712px width, open the main navigation.

Tested:
case #1. The fix works when we have a single autocomplete field.
case #2.Also works when we add another item.

Thanks!

ankithashetty’s picture

  • lauriii committed 564c312e on 11.x
    Issue #3405576 by kostyashupenko, penyaskito, ankithashetty,...

  • lauriii committed 328369e7 on 10.2.x
    Issue #3405576 by kostyashupenko, penyaskito, ankithashetty,...

  • lauriii committed 855aad36 on 10.1.x
    Issue #3405576 by kostyashupenko, penyaskito, ankithashetty,...

lauriii’s picture

Version: 11.x-dev » 10.1.x-dev
Status: Reviewed & tested by the community » Fixed

Committed 564c312 and pushed to 11.x. Cherry-picked to 10.2.x and 10.1.x. Thanks!

Status: Fixed » Closed (fixed)

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