Problem/Motivation

tabledrag.js has a mysterious and completely unnecessary addition of "menu-item__link" class to the first link in a table drag row. This doesn't seem to have any purpose and doesn't make sense if you're rearranging things other than menu links.

Proposed resolution

Remove the code that adds these classes.

Remaining tasks

Review.

User interface changes

None.

API changes

None (compared to Drupal 7). This seems like it may have been accidentally added at some point.

Comments

quicksketch’s picture

StatusFileSize
new603 bytes

Patch.

quicksketch’s picture

Status: Needs review » Needs work

Oh, hmm seems like this class *is* used in system.module.css. Very odd, why would it have the name "menu-item__link", and why would tabledrag.js be responsible for adding this class? It seems like something that should be moved to be part of the CSS for the particular table it's intended to affect.

mahtoranjeet’s picture

Status: Needs work » Needs review
StatusFileSize
new1.07 KB

Removing class from "menu-item__link" from tabledrag.js and system.module.css. Asuming it is not in used in else where. Or what is your suggestions.?

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

droplet’s picture

Component: javascript » markup

this is adding from #75 of #1261002: Draggable tables do not work on touch screen devices. I can't find the actual usage anyway.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dawehner’s picture

Just a random suggestion. What about adding some JS for the menu UI and remove this additional class from the generic tabledrag.js?

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should 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.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should 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.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
Issue tags: -JavaScript +JavaScript
StatusFileSize
new165 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

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

gauravvvv’s picture

Status: Needs work » Needs review
StatusFileSize
new544 bytes

Patch #3, no longer applies as #18. I have re-rolled the patch. please review

smustgrave’s picture

Status: Needs review » Postponed (maintainer needs more info)

We have css in tabledrag.css for menu-item__link, are we 100% sure it's not used.

gauravvvv’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new503.87 KB
new9.01 MB

We have css in tabledrag.css for menu-item__link, are we 100% sure it's not used.

.touchevents .draggable .menu-item__link {
  padding-top: var(--space-xs);
  padding-bottom: var(--space-xs);
}

This CSS is applied to mobile devices, as the `.touchevents` class is available their only. But it doesn't have any effects on the element. As the parent element have property `vertical-align: middle;`. There is no need to align element by padding. I have added a screen recording for reference.

gauravvvv’s picture

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Makes sense.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new85 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. 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.

gauravvvv’s picture

Version: 9.5.x-dev » 10.1.x-dev
Status: Needs work » Reviewed & tested by the community

Unrelated failure. restoring status

catch’s picture

Status: Reviewed & tested by the community » Needs work

#21 sounds good but if so shouldn't we also remove that CSS rule? Or at least open a follow-up.

gauravvvv’s picture

Status: Needs work » Needs review

I have opened up a follow up issue for same.
#3355904: Removed unused CSS from tabledrag.css file

santosh_verma’s picture

#catch i have tested the comment #27 mentioned issue, (https://www.drupal.org/project/drupal/issues/3355904).

Unused css removed after the MR,
for reference i am also adding the screenshot here.

santosh_verma’s picture

Status: Needs review » Reviewed & tested by the community
santosh_verma’s picture

Tested the comment #19 (forget to add this before moving to RTBC)

class removed from the element

before
before

after
after

bnjmnm’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new412.15 KB

If you review this change with core's default styling (Stark), it looks like removing this class results in the label and tabledrag handle not being aligned. This would be a regression seen by sites not using Claro.

Because the issue was filed 9 years ago, there's a high likelihood that some sites have CSS expecting this class to be there. At the very least, the Stable 9 theme would need logic that keeps this class present so it maintains the "stable promise"

However, the image above also indicates that this class is not irrelevant. We could not remove it + all corresponding CSS. Refactoring would be needed, not just removal. At that point, there's a risk of disrupting existing sites to provide a class with a slightly better name, so I'm not sure how much incentive there is to make this change vs the disruptions it might cause + adding the Stable9 layer.

(if there's a decision to go ahead with this, there are comments in the code referencing this class that were not part of the patch. If we're removing something, all artifacts of it should be removed)

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.

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.