Skip to content

Commit 0a02de1

Browse files
committed
fixes #775 gotoPath in focused mode
1 parent a9db0dc commit 0a02de1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/rapidoc.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,11 @@ export default class RapiDoc extends LitElement {
765765
this.scrollTo(elementId);
766766
}
767767
} else if (this.renderStyle === 'focused') {
768-
const defaultElementId = this.showInfo ? 'overview' : this.resolvedSpec.tags[0]?.paths[0];
769-
this.scrollTo(defaultElementId);
768+
// If goto-path is provided and no location-hash is present then try to scroll to default element
769+
if (!this.gotoPath) {
770+
const defaultElementId = this.showInfo ? 'overview' : this.resolvedSpec.tags[0]?.paths[0];
771+
this.scrollTo(defaultElementId);
772+
}
770773
}
771774
}
772775

@@ -902,7 +905,6 @@ export default class RapiDoc extends LitElement {
902905
// for focused mode update this.focusedElementId to update the rendering, else it wont find the needed html elements
903906
// focusedElementId will get validated in the template
904907
this.focusedElementId = elementId;
905-
await sleep(0);
906908
}
907909
if (this.renderStyle === 'view') {
908910
this.expandAndGotoOperation(elementId, expandPath, true);

0 commit comments

Comments
 (0)