In Firefox i got this error after dragging a few paragraphs around:

TypeError: childList.getAttribute is not a function

I cant provide excat instructions how to repoduce this ATM.

Comments

Lukas von Blarer created an issue. See original summary.

luksak’s picture

Issue summary: View changes
luksak’s picture

Title: JS error: TypeError: childList.getAttribute is not a function » Drag and drop mode JS error: TypeError: childList.getAttribute is not a function
miro_dietiker’s picture

Status: Active » Postponed (maintainer needs more info)

Never happened while we tested. But i also didn't test with FF.

Plz provide more info how to reproduce.

We might raise prio if reproducible.

luksak’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

This was also when using 1.6.0. Let's close this for now.

luksak’s picture

Status: Closed (cannot reproduce) » Needs review
StatusFileSize
new488 bytes

I was able to reproduce this now. It happens when reordering on the top level with nested paragraphs.

updateNestedPath() calls itself recursively, but passes the arguments in the wrong order.

This patch solves the issue for me. It is Only tested in Firefox so far.

miro_dietiker’s picture

Status: Needs review » Needs work

It seems the variable names are pretty disconnected from what they are about.
From reading the code, i have a hard time to understand what needs to be wired with what.

function updateNestedPath(childList, parentIndex, parentListItem) {
...
            updateNestedPath(this, childIndex, $childLi);

I put this back for work, to deliver something that is better readable for commit.
If this is broken for children, i wonder why nested things work in Chrome at all?

luksak’s picture

StatusFileSize
new1.66 KB

Uhm... tried something. Better now?

We also have a very weird mix between jQuery code and plain JS here... What should we go for? But that's a separate issue.

luksak’s picture

Status: Needs work » Needs review
pivica’s picture

Damn it, didn't saw this, duplicate issue with similar patch on https://www.drupal.org/node/2901862.

miro_dietiker’s picture

Status: Needs review » Fixed

Committed, thx.

Any follow-up for this jQuery / ES thing?

pivica’s picture

> Any follow-up for this jQuery / ES thing?

I think general idea in D8 is to use native Javascript code as much as possible because API is now much better than for D7 and before - so we should use clean JS when possible and jQuery only when needed. But this is a bit bigger issue because we should check all our custom JS code and also not very important for now - jQuery is shipped with D8 anyway.

Not sure should we create some follow up for now or just try to write more native JS in future and slowly start converting code?

Status: Fixed » Closed (fixed)

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