LiveReport page - Anchor tags reloading same page

Description
simonbentley
Posts: 2
Joined: Tue May 07, 2019 3:57 pm

LiveReport page - Anchor tags reloading same page

Postby simonbentley » Tue May 07, 2019 4:08 pm

Hello, I hope you can help me as I am fairly new to all of this.

I have a LiveReport page with a Table of Contents. Clicking on any item in the Contents table smoothly jumps to the relevant section of the report saving a lot of scrolling on a long page. I tried to create an anchor tag to jump the user back to the Top of the page. However, the link just ignores what I want to do and instead reloads the page creating needless server load, as well as making the user wait.

I have noticed that the same happens in the Wiki Syntax Help page too... #/wiki/Doc/SyntaxHelp. Click on any Contents heading and you jump smoothly. Click any "top" hyperlink and the page reloads instead of jumping smoothly to the top of the page.

I have tried many different things, including right-click Inspect Element and copy that, I have tried various flavours of anchor tag, e.g. #/wiki/Doc/SyntaxHelp#top and #/wiki/Doc/SyntaxHelp?selection=top with no joy.

Would very much appreciate any suggestions. I am using Chrome 74.0.3729.131 with Polarion Build: 3.17.2.20170912-2248.

Many thanks,

Simon

Jürgen
Posts: 82
Joined: Tue Sep 12, 2017 1:02 pm

Re: LiveReport page - Anchor tags reloading same page

Postby Jürgen » Thu May 09, 2019 7:12 am

Hello, Simon

could you check if the same behavior is done also with a different browser?

Jürgen

SteffPoint
Posts: 66
Joined: Wed Mar 07, 2018 1:06 pm

Re: LiveReport page - Anchor tags reloading same page

Postby SteffPoint » Fri May 10, 2019 6:30 am

I probably found an alternative with the JavaScript "scrollIntoView()" method for your demand.

You basically need two script blocks.

The script block you want to jump from:

Code: Select all

<button onclick="myFunction()">Click me</button>

<script>
function myFunction() {
document.querySelector('.hello').scrollIntoView({
  behavior: 'smooth'
});
}
</script>


and the script block you want to jump to:

Code: Select all

<div class="hello">asdasd</div>


I have tested it with current version of Chrome and for me it is working fine.

Let me know if that helped you.


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: Google [Bot] and 13 guests