For example, in a custom layout situation where the region content appears in a structure like this:
<div {{ region_attributes.first }}>
<div>
{{ content.first }}
</div>
</div>
The Drag-and-drop reordering doesn't work because the selector takes .js-layout-builder-region > .js-layout-builder-block instead of .js-layout-builder-region .js-layout-builder-block.
Comment | File | Size | Author |
---|---|---|---|
#44 | 3062742-44.patch | 1.1 KB | weseze |
#41 | reroll_diff_40-41.txt | 1.88 KB | zeeshan_khan |
#41 | 3062742-28.patch | 2.63 KB | zeeshan_khan |
#40 | 3062742-27.patch | 3.12 KB | justskew |
#36 | 3062742-26.patch | 1.5 KB | bernardm28 |
|
Issue fork drupal-3062742
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
dejanp CreditAttribution: dejanp as a volunteer commentedI think this shouldn't break anything.
Comment #4
dejanp CreditAttribution: dejanp as a volunteer commentedBecause of the deprecation of the jQuery UI library, this patch applies to Drupal 8.8.x and above.
Comment #5
tim.plunkettIs this something that could be tested with a functional JS test?
Comment #6
tim.plunkettComment #7
andrimont CreditAttribution: andrimont commentedThis is great, thank you @pinkdexo
It helps me to save the use of the layout of the TheMag theme -a great work-.
In my case Drupal 8.8.4 I used the #4 patch.
Success to get back the useful drag and drop !
Comment #10
dejanp CreditAttribution: dejanp as a volunteer commentedThis is an updated patch that works with D9. It could be tested with functional JS but not sure how to do that because it requires a specific template structure - shown in comment #1.
Comment #11
djsagar CreditAttribution: djsagar at OpenSense Labs commentedAs Patch is created for above issue i changed the status need work to need review.
Comment #12
djsagar CreditAttribution: djsagar at OpenSense Labs commentedComment #13
TylerMarshall CreditAttribution: TylerMarshall as a volunteer and at Underscore Software Inc commentedThis patch (tested the 8.9.x) works flawlessly for me.
Comment #15
BenStallings CreditAttribution: BenStallings at Interdependent Web LLC for Unitarian Universalist Association commentedPatch #10 works for me, too.
Comment #16
tim.plunkettGlad it's working! Now just for the automated test coverage...
Comment #17
naveen433 CreditAttribution: naveen433 at Valuebound for Valuebound commentedI am working on this
Comment #18
naveen433 CreditAttribution: naveen433 at Valuebound for Valuebound commentedcheck the drupal standards
Comment #19
Gauravvvv CreditAttribution: Gauravvvv at OpenSense Labs for Drupal India Association commentedRe-rolled patch #18, Attached interdiff for same.
Comment #20
ranjith_kumar_k_u CreditAttribution: ranjith_kumar_k_u at Zyxware Technologies commentedFixed custom command failure
Comment #22
danflanagan8I tried writing tests for this and boy was it hard! I have a partial test in this patch. I don't know how to make it any better.
The problems I had were:
1.
SortableTestTrait::sortableTo()
only simulates a drag and does actually have the browser perform drag and drop.2. For some reason I don't understand,
NodeElement::dragTo()
wasn't working for LB blocks, even with the default templates.This is just a new fail test, so no interdiff.
Comment #23
danflanagan8Sorry...Here's another.
Comment #25
danflanagan8That failed exactly as expected. Clicking the body block did not trigger any sort of "sortable" behavior. Here's the fail patch with the fix from #10 added.
NOTE: Ignore that interdiff. The correct one is attached to #26.
Comment #26
danflanagan8Ignore that interdiff. Oof.
Here's the real interdiff, which is simply the fix from #10.
Comment #27
danflanagan8Aha! Here's why my attempts to use
NodeElement::dragTo()
weren't working. Per the SortableTestTrait:This is tracked in an issue: #3078152: Follow-up to #3064049 Deprecate sortable Trait.
I'm pretty sure we can't make a good test for this issue until Chromium supports html5 drag and drop. I say that because the following test runs flawlessly on 9.3.x.
That is, big existing test does not fail with the custom templates featuring extra wrapping divs.
I think the wisest move would be to postpone this issue until the Chromedriver bug is fixed. To me it looks like there's no existing robust test coverage of LB drag-and-drop, which makes changes really risky!
That said, anyone running into this bug will probably be ok with the patch in #10.
The fail patch from #23 will be easy to update when we can do real dragging, so that's a good start.
Comment #29
TylerMarshall CreditAttribution: TylerMarshall as a volunteer and at Underscore Software Inc commentedThank you thank you thank you!
Patch 25 works for me just fine! I can RTBC!
Comment #30
danflanagan8This still needs tests, so back to NW.
Comment #33
HeikkiY CreditAttribution: HeikkiY commentedWe are seeing this same bug with Drupal core 9.4.8 and following contrib modules:
- Field group 8.x-3.3
- UI Patterns 8.x-1.3.
We have a content display mode with multiple regions
Regions are something like:
- Header
- Main content
- Footer
When I create a field group inside the region, the drag breaks completely.
There is also a related issue in Field group: https://www.drupal.org/project/field_group/issues/3085858.
I have tried the patches from issues 3089151, 3087608 and this one. It seems it gets a little bit better and with trial and error I can get the field to stay in a correct region. But sometimes it just resets. Here is a attached video recording of what happens when I drag multiple times and then save.
Without the patches, the dragging is completely broken and you cannot even stop the drag. The field you are dragging just keeps following you. With the patch from issue 3087608 the dragging works a bit better but it let's me let go of dragging. But after saving the form, the region is still reset.
Without the patches the functionality seemed to be that if I try to drag the field to a region, it gets assigned to the first available region instead of the one I would like to drag the field to. I have tested this with Claro, Gin and Seven admin themes.
Comment #36
bernardm28 CreditAttribution: bernardm28 at The University of Tennessee at Chattanooga commentedRerolls the patch to make it compatible with 9.5
Comment #39
ctrlADelLooked like the reroll was missing the tests that were in the patch from #25 so pushed those to both the 9.5 and 10 MRs
Comment #40
justskew CreditAttribution: justskew commentedFixed for drupal/core:9.5.3
Comment #41
zeeshan_khan CreditAttribution: zeeshan_khan as a volunteer commentedPatch rerolled for 9.5.x
Added reroll diff.
Comment #42
smustgrave CreditAttribution: smustgrave at Mobomo commentedWas previously tagged for tests which still need to happen.
Also issue summary could use some updating.
Thanks.
Comment #44
weseze CreditAttribution: weseze as a volunteer commentedRerolled for D10.1.x
Comment #45
xeiro CreditAttribution: xeiro as a volunteer commentedI can confirm #44 patch applies to D10.1.8
Comment #46
zeeshan_khan CreditAttribution: zeeshan_khan as a volunteer commented@weseze - Please provide interdiff
Also we need a re-roll for 11.x