Core's tabledrag.js doesn't work with current version

Created on 2 April 2020, almost 5 years ago
Updated 15 November 2024, 3 months ago

After installing the module (using Drupal 8.8.4) and setting a field to use a draggable table, the rows will not drag and there are javascript errors in tabledrag.js.

It is looking for the first cell of the first row and cannot find it. If you edit the tabledrag.js like this it works:

- 542     if (row.offsetHeight === 0) {
-       rowHeight = parseInt(row.firstChild.offsetHeight, 10) / 2;
-     } else {
-         rowHeight = parseInt(row.offsetHeight, 10) / 2;
-      }
 
+ 542 rowHeight = parseInt(row.offsetHeight, 10) / 2;

OR if you edit the tabledrag.checkbox.js like this, it also works.

- 114      var spacer = '<tr class="tabledrag-sort-spacer"></tr>';
+ 114      var spacer = '<tr class="tabledrag-sort-spacer"><td></td></tr>';
πŸ› Bug report
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States electrokate

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024