Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/openapi-explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ export default class OpenApiExplorer extends LitElement {
const gotoEl = this.shadowRoot.getElementById(tmpElementId);
if (gotoEl) {
gotoEl.scrollIntoView({ behavior: 'auto', block: 'start' });
gotoEl.focus();
replaceState(tmpElementId);
}
}, isExpandingNeeded ? 150 : 0);
Expand Down Expand Up @@ -459,6 +460,7 @@ export default class OpenApiExplorer extends LitElement {
const gotoEl = this.shadowRoot.getElementById(anchor.replace('#', ''));
if (gotoEl) {
gotoEl.scrollIntoView({ behavior: 'auto', block: 'start' });
gotoEl.focus();
}
}
}
Expand Down Expand Up @@ -603,19 +605,21 @@ export default class OpenApiExplorer extends LitElement {
component.expanded = true;
}
contentEl.scrollIntoView({ behavior: 'auto', block: 'start' });
contentEl.focus();

// Update Location Hash
replaceState(elementId);
newNavEl = this.shadowRoot.getElementById(`link-${elementId}`);
} else if (elementId.match('cmp--') || elementId.match('tag--') || elementId.match('overview--') || elementId.match('auth--') || elementId.match('servers--')) {
contentEl.scrollIntoView({ behavior: 'auto', block: 'start' });
contentEl.focus();

// Update Location Hash
replaceState(elementId);
newNavEl = this.shadowRoot.getElementById(`link-${elementId}`);
} else {
this.shadowRoot.getElementById('operations-root').scrollIntoView({ behavior: 'auto', block: 'start' });

this.shadowRoot.getElementById('operations-root').focus();
// Update Location Hash
replaceState(elementId);
newNavEl = this.shadowRoot.getElementById(`link-${elementId}`);
Expand All @@ -642,6 +646,7 @@ export default class OpenApiExplorer extends LitElement {
if (waitForComponentToExpand) {
setTimeout(() => newNavEl.scrollIntoView({ behavior: 'auto', block: 'center' }), 600);
}
newNavEl.focus();
}

await sleep(0);
Expand Down
Loading