wagtail-deprecated / wagtail-react-streamfield

Powerful field for inserting multiple blocks with nesting. (NO LONGER MAINTAINED - See Wagtail 2.13 Release Notes)
https://wagtail.github.io/react-streamfield/public/
BSD 3-Clause "New" or "Revised" License
74 stars 23 forks source link

Reordering blocks not saved #30

Closed grasshoppermouse closed 5 years ago

grasshoppermouse commented 5 years ago

I have the following stream field:

description = StreamField([
        ('heading', blocks.CharBlock(classname="full title")),
        ('paragraph', blocks.RichTextBlock(icon='pilcrow')),
        ('image', ImageChooserBlock(icon='image', template='department2/blocks/image.html')),
        ('image_carousel', blocks.ListBlock(ImageChooserBlock(), template='department2/blocks/image_carousel.html')),
        ('embedded_video', EmbedBlock(icon="media")),
    ])

When I reorder the top-level blocks (e.g., heading or paragraph) via drag-and-drop or arrows, and then Publish, the reordering is preserved. However, when I reorder the images in the image_carousel, the reordering is not preserved on Publish.

However, when I use the standard wagtail admin (no react-streamfield), it works fine, and reordering is preserved at all levels.

Any ideas?

BertrandBordage commented 5 years ago

I can’t reproduce the issue, even with exactly the same blocks as you.

Could you tell me the following?

grasshoppermouse commented 5 years ago

wagtail 2.4 wagtail-react-streamfield 1.1.0 DEBUG: True or False It happens using drag-and-drop or arrows

It doesn't happen for the top levels blocks, but it does happen for the carousel.

Here is a screencast:

https://gfycat.com/TartSaneImperatorangel

BertrandBordage commented 5 years ago

Mmm, weird, I still can’t reproduce it. Could you force refresh the browser cache with ctrl+F5 (on Linux/Windows) and retry?

grasshoppermouse commented 5 years ago

I did "Empty Caches" in the Safari Development menu (which fixed the last problem I had). But it doesn't fix this issue. Also tried it in Chrome after clearing the cache, and again, the problem is still there.

BertrandBordage commented 5 years ago

I see something weird in your screencast though. Your duplicate icon doesn’t work, it’s a square floating on the right. This shouldn’t be, there is a new icon I added to the Wagtail font. could you see if there is an error in the developer console, please?

BertrandBordage commented 5 years ago

Could you try again with 1.1.1 please?

grasshoppermouse commented 5 years ago

Tried it with 1.1.1 after cleaning cache; problem is still there. No errors in javascript console. Duplicate icon is still a square in Chrome, but now floating to the left of the trashcan. It's to the left but now invisible in Safari.

BertrandBordage commented 5 years ago

Could you try again with version 1.2.0 please?

grasshoppermouse commented 5 years ago

It's working now. Thanks!