Commit ede65b25 authored by Samantha Ming's avatar Samantha Ming Committed by Simon Knox

Append targetPath as a string to skip encording

If we used "searchParams.set()", the hash L1,
it would be changed to percentage L1. Which triggers the bug.
To solve this, we append the targetPath as a string.
This will bypass the encoding.
parent 8e0f0600
......@@ -126,8 +126,9 @@ export default class Project {
const refs = this.fullData.Branches.concat(this.fullData.Tags);
const currentRef = refs.find((ref) => loc.indexOf(ref) > -1);
if (currentRef) {
const targetPath = loc.split(currentRef)[1].slice(1);
const targetPath = loc.split(currentRef)[1].slice(1).split('#')[0];
selectedUrl.searchParams.set('path', targetPath);
selectedUrl.hash = window.location.hash;
}
}
......
---
title: Fix bug branch change with line selected
merge_request: 52285
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment