Problem/Motivation
Using nested paragraphs creates multiple drag handles.
What it looks like with Paragraphs module:

What it looks like with CD_Tools module "tabledrag" test page:
| Expected layout | Actual layout |
|---|---|
![]() |
![]() |
Scope of the bug:
This issue does not happen with the Seven theme and is scoped to the Claro tabledrag, which has overriden the core tabledrag and added some wrappers and other divs to the html so that we end up with 3 drag handles. The problem doesn't come up with any other place in admin UI, but the nested paragraphs use the "multiple drag".
DOM inspector analysis
The output for the Seven admin theme:
<td class="field-multiple-drag">
<a href="#" class="tabledrag-handle" title="Drag to re-order">
<div class="handle"> </div>
</a>
</td>And the output for the Claro theme:
<td class="field-multiple-drag tabledrag-cell tabledrag-cell--only-drag">
<div class="tabledrag-cell-content js-tabledrag-cell-content">
<a href="#" class="tabledrag-handle js-tabledrag-handle" title="Drag to re-order"></a>
<div class="tabledrag-cell-content__item">
<div class="tabledrag-cell-content js-tabledrag-cell-content">
<a href="#" class="tabledrag-handle js-tabledrag-handle" title="Drag to re-order"></a>
<a href="#" class="tabledrag-handle js-tabledrag-handle menu-item__link" title="Drag to re-order"></a>
<div class="tabledrag-cell-content__item"></div>
</div>
</div>
</div>
</td>It adds the handle three times.
Steps to reproduce with Paragraphs:
1. Create a new paragraph type (sub paragraph) (can be empty without fields)
2. Create two other paragraphs (main paragraphs) (the other one can be empty without fields)
3. Add a Paragraph field to the other main paragraph and include to sub paragraph in the reference type.
4. Add a Paragraph field to basic page and include the two main paragraphs in the reference type
5. Add a basic page and add there the paragraph type which has the sub field. It shows the three drag handles for the sub paragraph
Steps to reproduce with CD_Tools:
1. Install and enable https://github.com/zolhorvath/cd_tools and enable the "Tabledrag" submodule packaged with it.
2. Visit url /tabledrag/nested and /tabledrag/nested-hierarchy, which shows several nested tabledrag handles.
Proposed resolution
Claro's JS currently adds drag handles based on a per-row basis, based this selector within that row td:first-child. This means that nested rows, can have handles added to their td:first-child as they are children of other rows being processed. Handle addition should instead be applied only to the immediate children of a given row.
Remaining tasks
Review
RTBC
Commit
- Refactor initColumns() function to replace jQuery.each() with javascript iterator.
User interface changes
Nested tabledrag tables will not display duplicate tabledrag handle icons.
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #149 | Screenshot 2020-12-19 at 03.02.01.png | 153.38 KB | ipwa |
| #149 | Screenshot 2020-12-19 at 03.01.39.png | 151.82 KB | ipwa |
| #145 | 3092181-145-90X.patch | 61.98 KB | gaards |
| #142 | 3092181-142-8X.patch | 63.6 KB | bnjmnm |
| #142 | 3092181-142-9X.patch | 62.11 KB | bnjmnm |
Issue fork drupal-3092181
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
Comment #2
LauraRocksComment #3
huzookaComment #4
huzookaThe bug exists in 8.9x as well.
Comment #5
huzookaComment #6
huzookaFrom @lauriii:
Comment #7
huzookaComment #10
huzookaComment #12
huzookaComment #13
huzookaThis specific issue is the bug of Claro's
tabledrag.jsrewrite, and happens in every case when draggable tables are nested into each other.Tabledrag_test module
I improved the
tabledrag_testmodule (core/modules/system/tests/modules/tabledrag_test) by adding a nested tabledrag test page. I refactored the originalDrupal\tabledrag_test\Form\TableDragTestFormto be able to re-using the code in the new form's controller.Basically, the existing test table is reused as the content of the parent table's first row's first cell.
TableDragTest
While I added the new test method, I has to refactor some minor things in this test class.
Drupal\FunctionalJavascriptTests\TableDrag\TableDragTest:testNestedDraggableTables. This is testing the nested draggable tables provided by the new test page added totabledrag_test.::testKeyboardAccessibilityinto a new, protected method::assertKeyboardAccessibilitythat accepts (optional) arguments ($drupal_path,$structure).::assertDraggableTable: These are$table_idand$skip_missing. They're used for making assertions on the parent table's structure.assertTableRowmethod: it got a new optional argument$skip_missingthat is used for optionally skipping those value assertions that's target field's aren't present in the parent table.findRowByIdalso had to got an additional argument because of the reasons above.Additional bugs I've found:
testRootLeafDraggableRowsWithKeyboardrendered in an another draggable table's row, but it's completely broken in core.testKeyboardAccessibilityandtestRootLeafDraggableRowsWithKeyboard.Todo: report issues.
Comment #15
bnjmnmThis is a reroll that was necessary after #2769825: Cannot swap tabledrag rows by dragging the lower over the upper row in tests
Unfortunately, this reroll results in
ClaroTableDragTestnot working. I believe it's due to how far within a target row a dragged row needs to be before it can be placed there.It can be made to work by changing the creation of currentRowCenterOffset to this:
const currentRowCenterOffset = direction === 'down' ? currentRowOffestY + (currentRowHeight / 4) : currentRowOffestY + (currentRowHeight / .75);, so the dragged row doesn't need to travel as far into the row it's trying to bump out of place. There may be a better way, but this is what I discovered when confirming the test failures were not due to problems with the reroll.Keeping at "Needs review" to trigger tests, but this should switch to "Needs work" automatically unless there's something up my my local test env.
Comment #16
huzookaRe @bnjmnm,
Actually, you are wrong. The test added in #13 uses the keyboard for testing the draggable tables.
Could you please provide an interdiff? It would help a lot.
(I do have a case that highlights why we need the calculation fixes, but the needed case is managed by the test module AND the test I changed in $13.)
Comment #18
bnjmnm-- right, I think this has more to do with the changes to TableDragTest that happened in #2769825: Cannot swap tabledrag rows by dragging the lower over the upper row in tests - the issue that also made the reroll necessary. The attached currentRowCenterOffset-attempt.patch adds that change to the offset and allows ClaroTableDragTest to pass. The interdiff of that attempt-patch and the current patch is interdiff_18--changing-currentRowCenterOffset.txt
There was also a code standards mistake in the reroll from #15 so a fix for that is attached too.
Comment #20
huzookaI'll create a demo module and a video for highlighting why the improved claro drag'n'drop is untestable with
dragTo(and why is it still much more better than the default).Comment #21
bnjmnmAh, I understand now. The tests are failing on
testDragAndDrop(), a method recently added toTableDragTestin #2769825: Cannot swap tabledrag rows by dragging the lower over the upper row in tests. That method usesdragTo(), which sounds like it's not appropriate for testing Claro's tabledrag. Overriding that method in ClaroTableDragTest, is a more appropriate solution than changing offsets (which felt out of scope even when I mentioned it).Comment #22
jhedstromDoes anybody know why Claro overrode core's
tabledrag.js? The git logs from the old contrib repo only have one commit message for that file:so it's unclear as to why the override is necessary...
Comment #23
jhedstromAh, nevermind, I found the other log messages using
--followsince the file was renamed, so there is a bit more history:Comment #24
lauriiiThere's also documentation in the tabledrag.es6.js about what we changed which might help understanding why it was done ✌️
Comment #25
interdruper commented#13 applies cleanly over 8.8.0 (the next patches do not) and it fixes the issue for me.
Comment #26
LauraRocks#13 fixes issue in 8.8.0. Nice work!
Comment #27
huzookaRe #25, #26:
The patch from #15 (and #18) are for core 8.9.x.
Comment #28
huzookaYesterday I released CD tools 2.4.
If you enable
cd_tools:tabledrag, you'll have even more complex draggable table examples on the/tabledragpath.Based on the nested draggable tables, Claro needs more work to be faultless.
Comment #29
huzookaComment #30
huzookaAdded a minor enhancement, and I also attached two videos that compare Seven (core-default tabledrag.js) and Claro (replaced tabledrag.js).
Claro seems to be RTL-friendly with the most recent patches.
Comment #32
huzookaComment #33
huzookaCore tabledrag does not add the expected tabledrag-changed mark if the moved row contains it somewhere (e.g. in a nested draggable table).
So I decided to skip that assertion (see the interdiff).
I also attached a screen capture that shows why the drag test fails with Claro.
Long story in short, Claro switches the rows only if the pointer device passes the 'hovered' row's middle line. This does not happens if we're using dragTo() for these kind of tests. But besides this, I still think that Claro's current approach is the best (current means the patch I attach now). The visual UX-explanation can be checked by watching the Seven-vs-Claro--draggable-table-with-mixed-row-height.mp4 video from #30.
Comment #35
huzookaComment #36
huzookaComment #37
huzookaIn order to make Claro's
tabledrag.jstestable withdragTo(), I had to overrideTableDragTest::testDragAndDrop()in, and besides this, make Claro's
tabledrag.jsdragTo-friendly (it seems to be a rare condition if the pointer moved 100 pixels in one step, but who knows...).Comment #38
huzookaComment #39
huzookaAnd here is the interdiff for #37 (I forgot adding it previously).
Comment #41
bskibinskiI tried patch #37 on drupal 8.8.1, but it failed to apply the patch for me. (with claro enabled as backend theme).
I tried this https://www.drupal.org/files/issues/2019-12-20/claro-nested_paragraphs_m... patch.
Or does it only work on the dev branch of drupal?
Comment #42
lauriii@bskibinski It seems like the patch only applies on the dev branch (8.9.x).
Comment #43
elgandoz commented@bskibinski & @lauriii : I adapted the patch #37 to work on 8.8.1.
I'm not sure if it's ok to post it here, but it could be handy for all the early adopters.
Comment #44
johan den hollander commented@elgandoz: Thanks, this works well on 8.8.1!
Comment #45
bskibinskiAwesomesauce! @elgandoz thank you so much! helps out a lot over here!
patch works great.
Comment #46
lendudeThere seem to be a fairly large number of unrelated coding standards cleanup changes in the tabledrag file, which makes reviewing this very hard. Any way that we can trim this down to the absolute minimal changes that are necessary to make this work?
Comment #47
saschaeggiFor me the patch doesn't apply with 8.8.2 and Paragraphs 1.10.0
Comment #48
swatichouhan012 commentedComment #49
huzookaRE @saschaeggi, @ swatichouhan: this is still fine.
The target version is 8.9.x, not 8.8.whatever.
I re-scheduled a test run for #37, and it seems that it still applies cleanly and passes the tests.
Back to NR.
Comment #50
elgandoz commented@saschaeggi the patch from #43, which is not meant for dev purposes, applies fine on 8.8.2.
Comment #51
elgandoz commentedComment #52
swatichouhan012 commentedComment #53
slasher13Applied patch.


before:
after:
Comment #54
slasher13Comment #55
bnjmnm@slasher13 I'm switching this back to "Needs review" as a core patch (particularly one of this size) requires a more thorough review than before/after screenshots. This is understandable, however, as I've seen plenty of documentation that suggests this is all that is required in the review process This guide does a good job of succinctly describing what is needed from a review.
I did a quick pass and spotted a few typos. For a patch this large further review is still needed, however.
s/equals to/equals
s/than/then
s/draggalbe/draggable
"drag'n'drop" should be changed to drag and drop to match usage in the rest of core.
s/currenty/currently
Comment #56
KondratievaS commentedTested on 8.8.2 version of Drupal core and result is OK
Comment #57
bnjmnmNavigating the issue queue is very confusing so it's understandable, but setting this to reviewed & tested by the community in #56 is not appropriate for a few reasons.
Comment #58
KondratievaS commentedComment #59
kualeeI rerolled the patch in #37 to fix spellings/grammar mistakes in #55
More review of source code would be required
Comment #60
kualeeComment #61
KondratievaS commentedRetested on 8.9.0 version of Drupal core and result is OK with patch from #59
Comment #62
kostyashupenkoComment #63
jungleCoding standards check must pass, see https://www.drupal.org/pift-ci-job/1578231
Comment #64
jungleMaybe #63 out of scope here
Comment #65
dakwamineHere is a not-thoroughly-tested-and-quick backport for Drupal 8.8.3 based on #59.
For 8.9.x, please check #59.
Comment #66
dakwamineSorry, I messed up with the name. Here is the same file with a better name.
Comment #67
bnjmnmThere are some in-scope coding standard violations.
yarn lint:cssreveals some violations added by this patch:node ./node_modules/eslint/bin/eslint.js ./themes/claro/. There may be existing arrays in these files that don't meet this standard, and those can remain as is as they were created before standards were updated. New code should adhere to this rule, however.
In addition to the CS items above, this still needs a full code review and evaluation of test coverage before it can be RTBC again.
Comment #68
bnjmnmThe JS file still needs to be reviewed. Posting what I have so far as it may be a moment before I can get to that.
Missing @param docblock info
The additional space here isn't consistent with other comments. I'd be fine with sneaking in the typo correction of s/styleing/styling and s/indetation/indentation too :).
Are these no longer needed due to changes in JS? Everything works well in Safari/IE, so it doesn't seem like they're needed, but I'd like to confirm
Comment #69
bnjmnmEven though there are many changes to the JS file, most of them fit into one of two categories: 1. managing scope by using
selfin a nested function 2. Changing several instances where ALL descendants are collected and changing to functions or selectors that get only immediate children or direct descendants, which I assume was the changes specifically targeted at this bug. It's probably worth one final review from me or someone else to triple-check uses offind()and selectors that might target all descendants when they shouldn'tThe tests that access the controller don't actually submit the form so there's no need to include
$form['actions']andsubmitForm()can be removed since it'll meet the interface requirements via inheritance and it's not actually used.I'm confused by these comments. It looks like the logic around it is copied from misc/tabledrag.es6.js - perhaps these comments were added so we know to ignore this chunk of code when troubleshooting?
Comment #70
lauriiiComment #71
lauriii#68.4: I'm not sure I could find reason for changing from using max-height: 100% to using overflow: visible other than that the current solution is simpler. It seems like this was introduced by @huzooka on #30 so I tried to reach out to him. He wasn't able to recall what was the specific reason he did that change but he thought it might have been some kind of browser compatibility issue. I tried testing most of our supported browsers and I couldn't see any difference between the two approaches.
#69.4 I removed the comment and opened follow-up for addressing it properly.
This should address feedback from #67-#69.
Comment #72
lauriiiHere's the follow-up: #3129871: Incorrect targetElement.className value when dragging table rows between regions.
Comment #73
bnjmnmThis looks good! I just spotted one thing:
The indentation here got bumped out of place
This should also get a 9.1.x-specific patch, it won't apply 100% cleanly to that branch.
Comment #74
vladimirausPatch for 8.9.x
Comment #75
vladimiraus8.8.x backport. Ignored the following test files in the original patch:
core/tests/Drupal/FunctionalJavascriptTests/TableDrag/TableDragTest.phpcore/tests/Drupal/FunctionalJavascriptTests/Theme/ClaroTableDragTest.phpComment #77
kaffia commentedTested #75 and it works like a charm! Great work!
Comment #78
hctomI don't think this is RTBC, because there is some feedback from #73 that mentions a 9.x patch which is not done yet. In addition to that, you only tested the patch from #75, but not #74.
Also changing the priority back to normal, because this bug should be taken care of really soon as Claro is used more widely in combination with paragraphs now.
Comment #79
vladimiraus@hctom indentation mentioned in #73 has been fixed.
I think we need different issue for
9.0and9.1.Can you list the issues you want me to fix?
Comment #80
hctom@VladimirAus: I only pointed out the 9.x patch but no more issues (if this has to be done in a different branch, perhaps there should be a follow up, even though I think the problem should be addressed for 9.x here as well). I reverted the status to "Needs review", because only the 8.8.x patch has been tested, but not the 8.9.x patch. So there is still some review need before being able to set it to RTBC.
Comment #81
bnjmnmThe 9.1 patch is in the scope of this issue and it does not require any extensive changes. It looks like the only necessary change is JavaScript formatting that is done with automatic build tools.
To make the 9.1 patch: Apply the 8.9 patch to the 9.1 branch then in /core run
yarn prettierandyarn build:jsto rebuild the JS files using the 9.1 standards. That should be all you need. Just one thing to watch out for: if any JS files change as a result of prettier/build:js that are not related to this patch, those should be reverted and not included.Comment #82
lauriiiHere's a reroll for 8.9.x and 9.0.x.
Comment #84
lauriiiRebuilt the .js files on the 8.9.x patch which seems to fix the test failure.
Comment #85
bnjmnmThe 8 and 9 patches both look good aside from an extremely minor nit in both:
CS nit. There needs to be a space before the first @param.
Comment #86
pavnish commentedComment #87
pavnish commented@bnjmnm #85 has been resolved.
Comment #88
nod_It seems parts of this patch should go to the main tabledrag.js file, It will not be pretty if we have to support 2 different versions of the tabledrag script which have different functionality. Could you separate which fixes should go in core and which ones should go in claro?
Seems seven is also broken in the nested tabledrag situation. Doesn't seem to be a claro-only issue.
are all the self = this lines necessary to fix the bug? seems like scope creep.
Comment #89
pavnish commentedComment #90
bjcooper commentedThe 8.8.x backport in #75 works like a charm for me.
Comment #91
serhii-che commentedFor me, the path #75 (8.8.x) works well. Tested on core 8.8.6.
Comment #92
bnjmnmRe #88
This problem doesn't occur in Seven. Screenshots attached for reference.
Good point, in all but one case there's no change in scope to necessitate the use of
selfThe instances of
self = this;added in this patch can all be removed with one exception (that could be addressed pretty easily);The
self = this;added ininitColumns()is only needed for this bit that appears near the end because the scope changes due to it being in a jQuery callback.This can be avoiding by iterating through
this.querySelectorAll('> thead > tr, > tbody > tr, > tr')instead. (done in the IE11 compatible way of iterating through a NodeList)Similarly, most added self.(anything) can be changed to this.(anything), although if they're next to pre-existing calls to the
selfvariable, those can remain asselffor consistency.To get this out of "needs work":
self = this;added in this patch should be removed,.self.(whatever)should be changed to usethis.(whatever)unless they are next to pre-existing uses ofself.(whatever)Comment #93
johan den hollander commented8.9.x patch from #87 works well for me with Core 8.9.0.
Comment #94
saschaeggiPatch from #97 works for me with Drupal 8.9 and Drupal 9.0
Comment #95
jwilson3... picking this one up for the D4D sprint to work on fixes for #92 ...
Comment #96
jwilson3I've addressed issues 1 and 2 from #92.
Regarding item 3, I tried using
this.querySelectorAll('> thead > tr, > tbody > tr, > tr')but when babel converts this down to es5, I get the following error in the js console:After inspecting
thisin the current context, I realized that the table could be target withthis.tablebut when I triedthis.table.querySelectorAll('> thead > tr, > tbody > tr, > tr');I get the following error in the js console:So I'm not sure what I'm doing wrong.
Futhermore, I don't get why we're going through all the trouble to back out jQuery, when the standard way to solve the parent scope problem in a javascript foreach is well known to just use
self = this. I've tested with leaving this single instance of self = this in place in IE11 and modern Chrome all seems to work as expected in both places (tested using https://github.com/zolhorvath/cd_tools at the /tabledrag/nested route).Anyway, here is a working patch against 9.1.x with interdiff agaist #87.
Comment #97
jwilson3whoops, ignore 3092181-87-90x.patch attached to the previous comment. I meant to upload the interdiff, but grabbed the wrong file🤦♂️.
Comment #98
bnjmnmThanks for the patches!
Regarding item 3, I tried using this.querySelectorAll('> thead > tr, > tbody > tr, > tr') but when babel converts this down to es5, I get the following error in the js console:This should work:
$table[0].querySelectorAll('> thead > tr, > tbody > tr, > tr').etc.....self = thiswas a necessary convention pre-es6. JavaScript now provides this scoping natively and native support should be used over a library whenever possible, particularly in the case of jQuery, which will eventually be phased out of Drupal. Whenever possible, new JS in core should avoid using jQuery.Comment #99
jwilson3Thanks for the explanation. I'll take another crack at it.
Comment #100
jwilson3This produces:
querySelectorAll requires that a selector with child combinators include the parent element, i.e
parent > child.So, my solution was to grab the parent element outside the selector then include "table" as the parent.
This now works:
However, I don't know how safe this is — there could be an unrelated sibling table that is not the table drag table. Is this something to worry about? Or is there a better way to code this?
I tried restoring "this" but now I'm getting a different error
So there is still a scope issue with using this inside the forEach.call() callback. The compile down to ES5 is not switching "this" to "_this2" (which would be the appropriate one for the parent context), so the only way I can see to do that is to use
self = thishere. However, when I do that, the table row weights are not properly hidden.I've tried all of the following, and none of these work properly; the first, third and fourth producing
Uncaught TypeError: [element].addColspanClass is not a function.There is something else going on here with scoped variables that I don't understand, and have not been able to properly troubleshoot.
Comment #101
jwilson3To clarify point 2 above with an image, when I use:
I see the following:
Comment #102
jwilson3Added issue template and provided "expected" vs "actual" screenshots from CD_Tools.
Comment #103
lauriiiI'm not sure we should convert the find to not use jQuery. It seems like we're using similar selectors in the same file so it would probably make sense to change them all at once. This way we don't have to worry about side effects of that change in this issue.
This removes the self, while keeping the selector consistent by continuing to use jQuery.
Comment #105
lauriiiNot sure what went wrong with generating patch in #103 🤷♂️
Comment #106
bnjmnmThe unnecessary
selfadditions spotted in #88 have been addressed. I've reviewed this several times and that was the last item I'm aware of that needed to be addressed. I applied the patch for one final manual review and everything is working as expected.Comment #107
nod_+1
Comment #108
luksakWorks for me.
Comment #109
nicolas s. commentedIt work for me
Comment #110
tanubansal commentedRTBC + 1
Comment #111
lauriiiRerolled #105 😁
Comment #113
bnjmnmThe test failure was an unrelated QuickEdit test known to intermittently fail. Switching back to RTBC.
Comment #114
rakesh.gectcrThanks everyone +1 for RTBC.
Those who looking for 8.9.2 https://www.drupal.org/files/issues/2020-05-28/3092181-87-89x.patch from Comment#87 works fine.
Comment #115
lukusHi - https://www.drupal.org/files/issues/2020-05-28/3092181-87-89x.patch was working very well for me, but unfortunately isn't effecting the change anymore.The patch wasn't being applied correctly - all good now.
Comment #116
saschaeggiOne thing I just came across due to #3164499: [Paragraphs] Missing "collapse all" / "edit all" button is that the "Collapse all / Edit all" Button is somehow still missing in Claro. Switching back to Seven the button is present, but not in Claro.
Edit: Also the more menu (three dots) is missing as well.
Seven:

Claro:

Comment #117
lauriiiResearched #116 and it seems unrelated to the issue that is being fixed here. #116 happens even before applying the patch here and seems to be caused by
claro_preprocess_field_multiple_value_formoverriding some render arrays that Paragraph is setting. Could you by any chance open a new issue for solving that?Comment #118
saschaeggi@lauriii done #3164979: Paragraphs: Missing "collapse all" / "edit all" buttons 🙂
Comment #119
saschaeggiComment #122
quietone commentedThe latest patch, #111, has coding standard errors, https://www.drupal.org/pift-ci-job/1793545. I think those need to be fixed.
And let's update the issue summary to state what the proposed resolution is and update the remaining tasks as well.
Comment #123
lauriiiMost of the coding standard issues seem to be related to CSSLint. However, Drupal core is not using csslint anymore: https://www.drupal.org/node/2868114. We should probably prioritize #2876298: [12.x] Remove scaffolded csslint and eslint config given that it causes some confusion. Or maybe there's a way to disable CSSLint from Drupal core?
Comment #124
bnjmnmRerolled and updated issue summary.
Comment #125
bnjmnmThis was previously RTBC and only needed a reroll so I'm switching back to that.
Comment #126
quietone commented@lauriii, thanks for the comments in #123. I am now less confused :-)
Comment #127
rdeboerSo.... at the end of all this we seem to have a community-tested fix, which is awesome.
What's the process for advancing this further?
Personally I feel this is an important fix for a big issue.
Can anyone enlighten us on whether this fix is slanted for inclusion in core 8.9.x/9.x and by when?
Comment #128
rdeboerJust to confirm that today (12 Sep 2020) the patch attached to comment #87 still works for Drupal 8.9.x.
If you have installed drupal from git then you can apply the patch like so:
Alternatively (and perhaps better), use
composerand adding the patch to yourcomposer.jsonfile:Then:
composer update --lockComment #129
larowlanwhy is this changed from `click` to ` click` because I can't see any reference to that in the discussion above - and this is in the views module, not claro
Comment #130
bnjmnmAddresses #129
Also want to mention that this issue would also be solved with #3083051: Refactor tabledrag when core issues are resolved the bug reported here is happening with code that was planned for removal once a few prerequisite issues were fixed.
Comment #131
pasqualleNeeds reroll. Patch does not apply any more.
Comment #132
msuthars@bnjmnm Thanks for your work. Re-roll the patch.
Comment #134
andy-blum#87 still applies cleanly to 8.9.7, but no longer fixes the problem
Comment #135
duaelfr#132 does not apply anymore on the 9.1.x or 9.2.x branches.
Reroll is not straightforward (there are conflicts on tabledrag.pcss.css and tabledrag.es6.js)
Comment #136
adityasingh commentedWorking on reroll for D9.2.x. will update soon.
Comment #137
adityasingh commentedReroll for 9.2.x
Comment #139
jeroentIs this issue still relevant since this bug is also fixed once #3083051: Refactor tabledrag when core issues are resolved is committed?
Comment #140
andy-blumI would assume this issues is still relevant since that bug is only relevant to D9. This multi-handle problem also impacts Claro in D8.
Comment #141
saschaeggiIf the other ticket only solves the issue for D9 then we either need to backport the solution of the other ticket for D8. Otherwise this issue is still very relevant, as the problem described here makes Paragraphs almost unusable with Claro in D8.
Comment #142
bnjmnmRerolls for 8 and 9
Comment #143
nicolas s. commentedPatches don't work for me in D9.0.10, can patch will be apply because it doesn't install ?
Comment #144
bnjmnm@Nicolas S. The patch applies to Drupal 9.1, so you could upgrade to that version (released last week) or you can roll a 9.0 version of the patch for your own use.
Comment #145
gaards commentedI made a reroll for 9.0 that some might find useful.
Comment #147
nicolas s. commentedPatch #145 works with drupal 9.0.10
Comment #148
nod_let's stay on track. The issue is about 9.2.x
Comment #149
ipwa commented#142 Works well for me on 8.9.11
Without patch
With patch
Comment #150
scotwith1tConfirmed #142 works on Drupal 9.1.0
Comment #151
nod_It's very close, just a few details. And also a good example of why I want to do #3083051: Refactor tabledrag when core issues are resolved sooner rather than later because this patch is also fixing some obscure but bad problems with the 'basic' core tabledrag:)
here the 'parent' table is not 'indentable' we can just order the elements, if it were 'indentable' it would show a bug in the core tabledrag (not the claro one). Where when you change the parent element indentation, it changes the children' and messes with the indentation of the 'inner' tabledrag. Need a follow-up so we can the rest of core.
Here the 'inner' table has no initial 'indentation', if there was an initial indentation, it would show another core bug where the first 'deepest' item of the 'inner' table get 2 drag handles, and the parent row seems like it doesn't have a drag handle (because the parent drag handle is added to the first 'deepest' item of the inner table). Need a follow up to fix this in core.
The 2 points are solved by the current patch so claro won't show those problems after this patch is in.
this.tableor justtable, let's not add more use of 'self' in the code.This is for init, no fancy selector, I would try querySelectorAll here, it's just for init.
This is changing the method signature of function, and it's changing the first parameter that might already be used. It would be best to not change the signature, or at least add the parameter after the existing one, otherwise there is a 100% change of breaking code using this somehow.
Also the return type is different, might want to keep that in line with the 'basic' tabledrag script. I know returning a function is not useful, but we got to keep method signatures stable.
should be
$cellsinstead ofcellsThis is what fixes issues 1. and 2., nice one :)
same here, method signature change to reverse (even if you don't use the parameters, need to update the doc saying the parameters are useless in case someone tries to change them).
Also need some more documentation on what changes, and should core update it's code to follow this? It's not obvious what is the difference.
this is a new property of the object, need to be declared/documented in the constructor.
Comment #152
bnjmnmI agree with @nod_ that #3083051: Refactor tabledrag when core issues are resolved should be prioritized over this as it would fix the issue by removing technical debt instead of just remixing it. If it weren't for the fact that this fix should get into 8.9, I'd close this issue as a duplicate.
While I'm not a fan of how this issue is getting more attention than my preferred #3083051: Refactor tabledrag when core issues are resolved I took care of #142 as that was a very complex reroll that was a little easier for me due to my familiarity with the changes that necessitated the reroll. Perhaps someone else can take care of the feedback in #151. It shouldn't be that difficult to address, so perhaps one of the many folks monitoring this issue to have a crack at it? Anyone motivated but stuck on (the objectively confusing) Drupal process stuff is welcome to ping me on Slack 🙂
Comment #153
lauriiiAre there changes that need to land as part of this change now that #3083051: Refactor tabledrag when core issues are resolved has been committed?
Comment #154
lauriiiSeems like based on #152 this could be closed. As a normal bug, this is not eligible for backport to 8.9.x anymore.
Comment #155
lauriiiI gave credit for contributors that should have received credit on this issue here: #3083051: Refactor tabledrag when core issues are resolved.
Comment #156
dakwamineOh! Thanks, that's why I didn't understand why I have been credited on an issue I've never been onto. ;) Well, this is too late, but I think me getting credit is a little too much in regards of what I have done... ^^' Good job anyone, though!
Comment #157
taiger commentedConfirmed #142 works on Drupal 8.9.13. Thanks!
Comment #158
bond708 commentedAny suggestions?
drupal 8.9.13
paragraphs 1.12.0
Thank you
Comment #159
dakwamine@bond708 you must apply the patch on drupal/core, not drupal/paragraphs.
Comment #160
luksak@Dakwamine true, but the patch doesn't apply for me against 8.2.x either.
Comment #161
ipwa commented@Lukas von Blarer the latest 8.x patch will apply to 8.9.x, you need to update.
For anyone using this patch in Drupal 8, please be aware that this patch will never make it to core. This issue was fixed in Drupal 9 and will not be backported to Drupal 8. What I would recommend is to use Gin in Drupal 8 where they have fixed the issue properly.
Comment #162
bnjmnmSince it sounds like many people facing this issue are still on Drupal 8, I want to mention that upgrading from 8 to 9 is much easier than any prior upgrades. No data migration is required, only code changes that can be made incrementally.
You'll first need to be on Drupal 8.8+. Use the upgrade status module to identify what needs to be changed in order for a site to be ready for D9 https://www.drupal.org/project/upgrade_status/. It will tell you what changes need to be made, and none of the changes will break a D8 site, it will just become D9 ready.
Once those changes are made, update core https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-to-...
Since this issue is Claro-specific, I should also mention that Claro has many improvements only available in 9. I encourage everyone facing this issue to give the 8 -> 9 upgrade a shot.
Comment #163
batkorThanks!
#142 worked
Drupal 9.1.5
Comment #164
priyanka.gavara commented#142 patch is not applying for
Drupal 9.2.1 . It worked till Drupal 9.1.4. Any help
Thanks in advance !
Comment #165
martijn de witI believe you don't need this patch in 9.2.x because the issue is resolved for 9.2.x in #3083051: Refactor tabledrag when core issues are resolved
Comment #166
dlaufer commented*comment removed*
Comment #167
andypostthe issue still exists, so follow-up is #3112245: Cross for multiple entity reference field in paragraph
maybe it needs another one for paragraphs