Problem/Motivation

The items in a tabledrag (menu, taxonomy, etc) are shifted up and not vertically centered with the drag handle.

menu

Looking at the HTML, I see that the handle in 11.0.11 went from

<a href="#" title="Move in any direction" class="tabledrag-handle js-tabledrag-handle"></a>

to this in 11.1.0
<a href="#" title="Move in any direction" class="tabledrag-handle"><div class="handle"></div></a>

which seems to indicate that it's coming from /core/misc/tabledrag.js instead of /core/themes/claro/js/tabledrag.js

The "Show row weights" link was also affected in a similar way.
show row weights

I suspect it has something to do with the recent changes is asset order: https://www.drupal.org/node/3473558

Steps to reproduce

Go to any form with a tabledrag element: /admin/structure/menu/manage/admin or /admin/structure/block or /admin/config/content/formats/manage/basic_html
Notice that the drag handle and text are not aligned and "Show row weights" is a blue text link.

Proposed resolution

Change claro's tabledrag.js weight to -1

Issue fork drupal-3506870

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

bwaindwain created an issue. See original summary.

quietone’s picture

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

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies.

bwaindwain’s picture

Title: Tabledrag missalignment » Tabledrag misalignment and "Show row weights" link
Issue summary: View changes
StatusFileSize
new5.74 KB
bwaindwain’s picture

I was able to fix this by changing web/core/core.libraries/yml from

misc/tabledrag.js: { weight: -1 }
to
misc/tabledrag.js: { }

which was inspired by https://www.drupal.org/project/drupal/issues/1945262

bwaindwain’s picture

bwaindwain’s picture

Status: Active » Needs review

created mr

rinku jacob 13’s picture

StatusFileSize
new184.28 KB
new191.55 KB

@bwaindwain, I have reviewed and tested your MR on Drupal 11.x-dev, and it was successful in removing the table drag weights from core.libraries.yml. Additionally, I can see the changes reflected in the UI, including the alignment table drag functionality. The row weights link has also been updated as expected.Thanks @bwaindwain

smustgrave’s picture

Status: Needs review » Needs work

Caused a number of failures. Not 100% sure about the solution as this could have some impact on custom/contrib modules not just this core issue.

Also summary still needs some love.

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

cb_govcms’s picture

StatusFileSize
new22.4 KB

Have also experienced this in Drupal 10, as mentioned stemming from the change in asset loading introduced in 10.4.

On some settings (such as Diff module) the icon is not just aligned oddly but causes wrapping issues:
icon wrapping in diff module setttings

In my testing this issue was only present when the Big Pipe module was enabled, rendering as expected otherwise.

Rather than modifying the core library I suggest changing the weight in Claro in new MR.

cb_govcms’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Bug Smash Initiative, +Needs screenshots

Not sure we can add tests for this but IS should be complete. Should always have proposed solution filled out, if multiple MRs can we close or hide ones that don't apply, and with UI bug before/after screenshots will help reviews

Thanks!

bwaindwain’s picture

StatusFileSize
new21.97 KB
new21.95 KB

Thanks @cb_govcms. MR !13023 works for me, and the tests pass. +1 RTBC

Before MR !13023
before

After MR !13023
after

bwaindwain’s picture

Issue summary: View changes
Status: Needs work » Needs review

bwaindwain changed the visibility of the branch 3506870-tabledrag-misalignment-and to hidden.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs screenshots

Confirmed this does fix the problem, we were seeing this on the book module too.

longwave’s picture

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

Backporting down to 10.5.x as a minor bug fix to the UI; I can't see that changing the weights will have any other side effects so this feels safe to me.

Committed and pushed ddb2a37d818 to 11.x and 66f35ad8f6e to 11.3.x and 19d511dc3c6 to 11.2.x and 0872ca1c512 to 10.6.x and 7bde88e3662 to 10.5.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • longwave committed 7bde88e3 on 10.5.x
    fix: #3506870 Tabledrag misalignment and "Show row weights" link
    
    By:...

  • longwave committed 0872ca1c on 10.6.x
    fix: #3506870 Tabledrag misalignment and "Show row weights" link
    
    By:...

  • longwave committed 19d511dc on 11.2.x
    fix: #3506870 Tabledrag misalignment and "Show row weights" link
    
    By:...

  • longwave committed 66f35ad8 on 11.3.x
    fix: #3506870 Tabledrag misalignment and "Show row weights" link
    
    By:...

  • longwave committed ddb2a37d on 11.x
    fix: #3506870 Tabledrag misalignment and "Show row weights" link
    
    By:...

Status: Fixed » Closed (fixed)

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