Named Link Testing
I placed some test code on the server yesterday, well to test!
I've noticed that there are times when you click "new" or go to a linked liked / mentioned message, you don't end up at the right spot on the page, usually overshooting the proper message. I don't know if it was just me seeing that behavior or if others have seen that as well.
In the past this was somewhat caused by the editor in the quick reply grabbing focus and messing things up. But thinking about it some more it may be caused by the code blocks we use. After a page loads the JS kicks in and makes the code blocks collapse to fit the code or set to a fixed height if there is a large code block. This moves the page about but the named link in the url (that #new or #msg1234) has already been navigated to.
So the testing code is some JS that runs a scrollTo after (and if) the code collapse code has triggered. Probably the full fix would be to prevent the browser default action (not sure you can) then add a scrollTo event as some promise from the code collapse, right now It just adds an on load event if the code code is run.
Anyway if you notice anything improved, unchanged or worse let me know.
Re: Named Link Testing
Reply #2 –
No GH link for the test code, just something I quickly put together and put in place to test.
No idea on the JS TBH, maybe its not needed any longer but was when we first began work on 1.0?. We could try new CSS and see if it works or not without the need for the JS swap.
ETA: Looks like this may have been an old ie8 issue with max heights and overflow auto ... bet we can drop all of that now
Re: Named Link Testing
Reply #8 –
Ah, thanks! I wasn't aware of that new property. I thought it was just a thing browsers (thankfully!) did these days, but I didn't know it was by implementing a new CSS property and changing the default stylesheet.
Yeah, that does drastically reduce the usefulness of the thing.
So load with max-height, CSS is much quicker than JS.
then on DOMContentLoaded go:
height = computedStyle height
max-height = auto
that'll prevent any bouncing.
Re: Named Link Testing
Reply #14 –
Thats not a bad idea at all ... amazing amount of churn over the font size on a site (or as its perceived on ones device)