mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-22 16:46:34 +03:00
fix: clear page fragment when scroll to the beginning
This commit is contained in:
parent
7b19417497
commit
929740ab28
|
@ -28,7 +28,7 @@ export class Hash {
|
|||
}
|
||||
|
||||
update(hash: string|null) {
|
||||
if (!hash) return;
|
||||
if (hash == undefined) return;
|
||||
this.noEmit = true;
|
||||
window.location.hash = hash;
|
||||
setTimeout(() => {
|
||||
|
|
|
@ -208,7 +208,10 @@ export class MenuService {
|
|||
|
||||
this.deactivate(this.activeIdx);
|
||||
this.activeIdx = idx;
|
||||
if (idx < 0) return;
|
||||
if (idx < 0) {
|
||||
this.hash.update('');
|
||||
return;
|
||||
}
|
||||
|
||||
item.active = true;
|
||||
|
||||
|
@ -409,7 +412,7 @@ export class MenuService {
|
|||
checkAllTagsUsedInGroups() {
|
||||
for (let tag of Object.keys(this._tagsWithMethods)) {
|
||||
if (!this._tagsWithMethods[tag].used) {
|
||||
WarningsService.warn(`Tag "${tag}" is not added to any group`)
|
||||
WarningsService.warn(`Tag "${tag}" is not added to any group`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user