Jump to content

Papers,anchors and chrome


Recommended Posts

Bug: Weird scrolling behaviour

Browser: Chrome

Interface: Any of the public papers

 

Description:When using anchors in a document, in this test replication, military beliefs, the anchor scrolls everything. In the example I build a list and filled it with 2 href='#anchorname' links.

 

After several <br/> I added at first a div with an id matching the anchor. Later also tried it with the <a name="anchorname" method the build in link creator seems to favor.

 

In both cases the outcome was the same, clicking on the link does not scroll down the scrollbar of just the papers document, but it scrolls the main browser view as well to ensure the anchor is at the top of your screen. This is shown in the added screenshot below.

 

Also added the sample code I used to replicate the bug.

 

(also, related to my previous bug report, clicking the anchorlink will also remove the red crosses on any further pop ups. Checked to ensure it was not save/edit/ok.)

 
<ul> 
  <li><a title="test 1" href="#test1">test 1</a></li> 
  <li><a title="test 2" href="#test2">test 2</a></li> 
</ul> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> 
<div> <a name="test1" title="test 1"></a>this is the first test
</div> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> 
<div id="test2" title="Test 2"> this is the second test
</div>

focus.jpg

Link to post
Share on other sites

Yes! As you can see in my papers, I know better ways then anchors.

But I don't think I can quite explain the javascript way for someone clueless on html in their knowledge document :)

 

Maybe she can use one of the templates being developed (yes yes still working on mine) and happily ignore this till then.

(cause yes, it is fairly trivial)

Link to post
Share on other sites

Yes! As you can see in my papers, I know better ways then anchors.

But I don't think I can quite explain the javascript way for someone clueless on html in their knowledge document :)

 

Maybe she can use one of the templates being developed (yes yes still working on mine) and happily ignore this till then.

(cause yes, it is fairly trivial)

 

Anchors break the chrome engine, its annoying and i havent found a nice way of fixing it so they dont, other than removing all the anchors in MD's script :))

 

I might work on it more later, but its annoying simply put.

Link to post
Share on other sites

Named <a> (anchor) tags are deprecated and should not be used, according to the WHATWG and the W3C.
Instead fragment-link identifiers (the #go-to-here thing) can reference any element with an id attribute.
 
For example I want to provide an anchor link to a later heading in the document, I would use:

<a href="#subheading1">Sub-Heading 1</a>

which would take me to:

<h2 id="subheading1">Sub-Heading 1</h2>

I don't know if this fixes the problem in MD, but it will be what chrome is expecting to see.

Edited by The Warrior
Link to post
Share on other sites

Named <a> (anchor) tags are deprecated and should not be used, according to the WHATWG and the W3C.
Instead fragment-link identifiers (the #go-to-here thing) can reference any element with an id attribute.
 
For example I want to provide an anchor link to a later heading in the document, I would use:

<a href="#subheading1">Sub-Heading 1</a>

which would take me to:

<h2 id="subheading1">Sub-Heading 1</h2>

I don't know if this fixes the problem in MD, but it will be what chrome is expecting to see.

MD cant fix a users code being wrong :)

Link to post
Share on other sites

Yes, but the a href version is just what the editor used :)

I started with id tags, didn't help much.

 

Md ca't fix wrong user code, but fixing wrong chrome workings is nearly impossible too

Read some stuff about using absolute positioning and such to fix it. Maybe I will poke around with that. Doesn't matter though. Wrote a jquery div hide, was quicker :)

Link to post
Share on other sites
  • 9 months later...
  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Forum Statistics

    16,149
    Total Topics
    176,377
    Total Posts
  • Recently Browsing

    No registered users viewing this page.

  • Upcoming Events

    No upcoming events found
  • Recent Event Reviews

×
×
  • Create New...