Radio buttons display and functionality broken
biki opened this issue · 10 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.
Note that radio buttons are not default Wagtail, but a customized ChoiceBlock:
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 :)
@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.