Skip to main content
Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.

vbourdeix

Member since Jul 12, 2018

Recent Blog Comments By vbourdeix

  • Creating A Jump-To-Anchor Fragment Polyfill In Angular 5.2.0

    Posted on Jul 13, 2018 at 3:42 AM

    Hey, I just overcame the issue with Chrome, it was quite simple in the end. Just add this code at the beginning of the ngOnInit in the FragmentTargetDirective : if ('scrollRestoration' in history) { history.scrollRestoration = 'manual'; } It disables the Chrome automatic scroll posi... read more »

  • Creating A Jump-To-Anchor Fragment Polyfill In Angular 5.2.0

    Posted on Jul 12, 2018 at 10:48 AM

    To be precise, I've got an issue only in Chrome. This works on first load with firefox and edge. I've noticed that the scroll happens during a microsecond before getting sent to the top for some reason. Probably linked to Chrome.... read more »

  • Creating A Jump-To-Anchor Fragment Polyfill In Angular 5.2.0

    Posted on Jul 12, 2018 at 10:36 AM

    It's quite similar to the solution I tried (without the polyfill approach) and it has the same issue for me : When I load the page, it doesn't work because, from what I suspect, the DOM element exists, so the scrollIntoView does not fail, but the contents are not loaded yet so it scrolls at ... read more »