Drf-yasg: ReDoc broken sidebar in Chrome 80

Created on 17 Feb 2020  路  7Comments  路  Source: axnsan12/drf-yasg

This fixed in version 2.0.0-rc.23 ReDoc
https://github.com/Redocly/redoc/issues/1167

Most helpful comment

As I see there is unmerged pr for this issue https://github.com/axnsan12/drf-yasg/pull/543

A bit elaborated solution above to fix my case when redoc is hosted somewhere:

  1. Create new app, let's say - 'drf_yasg_templates'
  2. Copy ...drf_yasg/templates/drf-yasg/redoc.html to the new app - drf_yasg_templates/templates/drf-yasg/redoc.html and replace
    <script src="{% static 'drf-yasg/redoc/redoc.min.js' %}"></script>
    with
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/bundles/redoc.standalone.js"></script>
  3. Add it to installed apps before 'drf_yasg'

All 7 comments

Is there a way how to use the fixed version via drf-yasg?

I have the same problem too, i'm using the version of drf-yasg: 1.17.1 and still happens

Is there a way how to use the fixed version via drf-yasg?

I fixed the bug: go to your html page and change this:

to this:

As I see there is unmerged pr for this issue https://github.com/axnsan12/drf-yasg/pull/543

A bit elaborated solution above to fix my case when redoc is hosted somewhere:

  1. Create new app, let's say - 'drf_yasg_templates'
  2. Copy ...drf_yasg/templates/drf-yasg/redoc.html to the new app - drf_yasg_templates/templates/drf-yasg/redoc.html and replace
    <script src="{% static 'drf-yasg/redoc/redoc.min.js' %}"></script>
    with
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/bundles/redoc.standalone.js"></script>
  3. Add it to installed apps before 'drf_yasg'

Since the fix for https://github.com/Redocly/redoc/issues/1167 is in https://github.com/Redocly/redoc/commit/1a2a7dd8331cedd6ced4c18accf0b417549b3ff3
it should be sufficient to add/inject

.menu-content {
    contain: unset !important;
}

Into your application somehow.

In my case,
The problem is solved by putting the latest redoc.min.js file in the Django static folder.

Fixed in master now, updated to rc40, sorry for disappearing.

Was this page helpful?
0 / 5 - 0 ratings