Redocly / redoc

📘 OpenAPI/Swagger-generated API Reference Documentation
https://redocly.github.io/redoc/
MIT License
23.69k stars 2.31k forks source link

When opening an HTML file built with the Redocly command in a browser that contains an anchor, the sidebar does not expand and automatically positions to that anchor. #2522

Open Zacama opened 7 months ago

Zacama commented 7 months ago

Describe the bug

When opening an HTML file url(built with the redocly build-docs command) with anchor in a browser, the sidebar does not expand and automatically positions to that anchor.

To Reproduce Steps to reproduce the behavior:

Here's an example https://github.com/Zacama/redoc-2522

Expected behavior

The sidebar expands and automatically positions to that anchor.

Logs

OpenAPI description

Redocly Version(s)

1.10.1

Node.js Version(s)

v20.11.1

Additional context

tatomyr commented 7 months ago

I believe that belongs to the Redoc repository. Transfering there.

Zacama commented 7 months ago

You can see the problem in action by going directly to this link https://sturdy-parakeet-vqj7xp64xp62pgqg-23232.app.github.dev/example.html#tag/example/paths/~1example/get

fmotas commented 6 months ago

news?

bratwurzt commented 2 weeks ago

This is still an issue and in case of swagger-to-redoc documentation, a blocker.

It looks like some javascript code in some cases disables the core functionality of deep links (it just jitters the screen).

The only way I can get it to work is if I either rename data-section-id tag to something else (e.g. data-section-ids) or change the value of data-section-id. Not working: <div id="operation/deleteDataSource" class="sc-eCApnc kzhJjR" data-section-id="operation/deleteDataSource"> Works: <div id="operation/deleteDataSource" class="sc-eCApnc kzhJjR" data-section-ids="operation/deleteDataSource">