question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Privacy option radio buttons display horizontally under Django 4.0

See original GitHub issue

The radio buttons in the Page Privacy modal are laid out horizontally when running under Django 4.0.3, where previously they were arranged vertically. (I think I’ve seen similar glitches in other places where radio buttons / checkboxes are used - e.g. m2m relations in the page edit form - although I don’t have any examples to hand)

Under Django 3.2.12: Screenshot 2022-03-22 at 10 49 00

Under Django 4.0.3: Screenshot 2022-03-22 at 10 49 26

Steps to Reproduce

  1. Set up bakerydemo with Django 3.2
  2. Log in to admin and edit a blog page
  3. Switch to the Settings tab and click on “Set page privacy”; see options laid out vertically
  4. pip install "Django>=4" and restart server
  5. Refresh page and click on “Set page privacy” again; see options laid out horizontally
  • I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: no (just on bakerydemo)

Technical details

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
prosheecommented, Mar 24, 2022

I figured out the problem by the inspect element in chrome and I run it as well, and it’s working fine. It can be solved by adding breaks tags easily, earlier it was not required, but now it is and the only problem is I am not getting where to change the code that I’ve seen with the help of inspect element.

2reactions
lb-commented, Mar 24, 2022

@proshee assuming you have a development environment up and running, the first step is to reproduce this locally.

Once you can reproduce it you should be able to have one browser open with the ‘working’ version and another with the ‘broken’ version.

From here, start exploring the CSS used in the browser inspector to see what could be wrong, my guess this is a DOM structure change (e.g. maybe the radio buttons are in ul and the used to be in a ol) or a classes change.

Other avenues of exploration

  • look at what widget / field is in use here and whether that is built in with Django, or something Wagtail uses with a custom widget
  • look at the Django 4.0 release notes about any changes that may have caused this issue
  • Google ‘Django 4.0 radio not showing correctly’ and see what comes up

Hope that helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Align radio buttons horizontally in django forms - Stack Overflow
I want to align the radio buttons horizontally. By default django forms displays in vertical format. feature_type = forms.TypedChoiceField( ...
Read more >
First Issues Bot on Twitter: "Privacy option radio buttons display ...
The radio buttons in the Page Privacy modal are laid out horizontally when running under Django 4.0.3, where previously they were arranged vertically....
Read more >
Align radio buttons horizontally in django forms - YouTube
Django : Align radio buttons horizontally in django forms [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] Django ...
Read more >
The Django admin site
When you put 'django.contrib.admin' in your INSTALLED_APPS setting, ... If a field is present in radio_fields , Django will use a radio-button interface ......
Read more >
Bootstrap 4 Radio Buttons in Form Tutorial with Examples
Set up Bootstrap Library in Your Project ; rel · stylesheet ; href · https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found