wagtail-deprecated / wagtail-react-streamfield

Powerful field for inserting multiple blocks with nesting. (NO LONGER MAINTAINED - See Wagtail 2.13 Release Notes)

Home Page:https://wagtail.github.io/react-streamfield/public/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Radio buttons display and functionality broken

biki opened this issue · comments

Wagtail 2.4
Wagtail react streamfield 1.2.0

Radio buttons within the edit form don't have enough space and grow into each other. Also they look like they're not properly given a name attribute which is why you're able to select more than one.

image

Note that radio buttons are not default Wagtail, but a customized ChoiceBlock:
image

Half of that issue was fixed by wagtail-deprecated/react-streamfield@e775cd3.
That fix is for the exclusive selection of a single radio button at a time.

What remains is to fix the CSS issue, it’s purely wagtail related.

The style issue was fixed by 45dcaf2, and the react-streamfield fix is in the version used by wagtail-react-streamfield now.

So everything here is fixed, and will be in the new wagtail-react-streamfield version :)

Unfortunately I have to open this issue again, it is still somewhat broken in 1.3.0

Screenshot 2019-08-08 at 08 32 37

Getting the following error:

Screenshot 2019-08-08 at 08 33 41

If you need more information from me, please say so. Thank you.

@biki Did you try force-refreshing the browser? With +shift+R on Apple computers and ctrl+F5 on everything else.

Yep. I know that Wagtail sometimes bugs out after updating but I've cleared the cache multiple times.

Was it using the exact RadioBlock you defined above? I’m asking because that’s what I used for testing, and it was working flawlessly.

Yep, using the same definition on Wagtail 2.6.1
I'm using RadioBlock like this:

image_text_cubes = ('image_text_cubes', blocks.StructBlock([
    ('title', blocks.CharBlock(required=False)),
    ('cubes', blocks.ListBlock(blocks.StructBlock([
        ('image', ImageChooserBlock()),
        ('image_position', RadioBlock(choices=DEFAULT_ALIGNMENT_CHOICES[:2], default='left')),
        ('title', blocks.CharBlock()),
        ('content', blocks.RichTextBlock()),
        ('list_style', RadioBlock(choices=DEFAULT_LIST_CHOICES, default='dash')),
        ('call_to_actions', blocks.ListBlock(CallToActions(), default=[], required=False, null=True, blank=True)),
    ]))),
], template='content/blocks/image_text_cubes.html', icon='fa-cubes', group=GROUP_NAME))```

OK, I can confirm I see a buggy behaviour with RadioBlock after values were saved with the old StreamField. I’m investigating it.

That last issue was fixed by df10ce3.
It was a bad radio serialization issue. I discovered another issue at the same time, one method was not correctly monkey patched, so the error messages were no longer shown in the field blocks.

That should fix your issue, tell me otherwise!

I forgot to tell you, it’s in a new 1.3.1 release.