swagger-ui: DeepLinking onClick does not scroll or open Operation.
Hi there! I see that an issue #2884 deeplinking was integrated to 3.x however if I have a hyperlink with a hash to the operationID nothing happens on click. If I reload the page the UI scrolls to the open panel as expected. Is there something I am missing here? My url looks as follows and I am using the 3.0 dist repo installed via npm.
Again when clicked the URL address is updated but nothing happens until the page is refreshed manually. Any suggestions?
<a href="#/pet/deletePet">Deletes a pet</a>
About this issue
- Original URL
- State: open
- Created 7 years ago
- Reactions: 3
- Comments: 26 (10 by maintainers)
Commits related to this issue
- bug(deeplinking): escaping breaks whitespaces & underscored tags/ids (via #4953) * add tests for operation lacking an operationId * add deep linking tests for tags/operationIds with underscores * m... — committed to swagger-api/swagger-ui by shockey 6 years ago
- ref #3958, support utf16 fragments on the deeplink plugin — committed to swagger-api/swagger-ui by TheNorthMemory 6 years ago
- improve(deeplink): support utf16 tags and IDs (via #4921) * ref #3958, support utf16 fragments on the deeplink plugin * put -> head for UTF16 operation this is a temporary fix, eventually we will r... — committed to swagger-api/swagger-ui by TheNorthMemory 6 years ago
Hey Can you assign this to me? I will try to fix the issue Thank you
@shockey Hi! After taking a long hiatus, I’m ready to jump back in to help get this issue resolved. Is there anywhere you’d recommend I start first?
Any news on this? I have also tried to add
<a href="#/components/schemas/event">Event</a>inside a description without anything happening when clicking it… Expected behavior is that the page scrolls to the Event componentIf anyone wants dynamic linking this is my current implementation using typescript and SwaggerUi v3.17.5.
A sidebar uses choosePath as a callback function and sends the desired link. layoutActions.show opens the chosen link and scrollTo will scroll the view to that link. Because it takes some time for the link to open I used a delay. While I understand using
setTimeoutis not the best I couldn’t figure out another way around it. Hope this helps!Quoting myself from #3963, since it’s relevant here: