Skip to content

Commit

Permalink
docs: mention firefox bug with <a href="#top">
Browse files Browse the repository at this point in the history
fix #18
  • Loading branch information
jonaskuske committed Dec 14, 2018
1 parent c8c855d commit c9e15e5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.4] - unknown
### Added
- Firefox bug where `<a href="#top">` doesn't smooth scroll now mentioned in docs
### Changed
- Update docs to mention Firefox supporting both `scroll-behavior` and `prefers-reduced-motion`
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
| --------- | --------- | --------- | --------- | --------- | --------- |
| IE9+, Edge| native| native*| last 2 versions| last 2 versions| native*

> \* hashchange navigation triggered by forwards/backwards buttons isn't smooth despite native support. [Learn more](https://jonaskuske.github.io/smoothscroll-anchor-polyfill#hashchange-blink)
> \* hashchange navigation triggered by forwards/backwards buttons isn't smooth despite native support. [Learn more](https://jonaskuske.github.io/smoothscroll-anchor-polyfill#native-inconsistencies)
&nbsp;

Expand Down
28 changes: 14 additions & 14 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<li><a class="button" href="#docs">Docs</a></li>
<li><a class="button" href="#legal">Legal</a></li>
<li></li>
<li><a href="#top">⬆ to Top</a></li>
<li><a href="#">⬆ to Top</a></li>
</ul>
</nav>
</header>
Expand Down Expand Up @@ -306,22 +306,22 @@ <h4 id="no-javascript-scroll"><code>scroll-behavior</code> doesn't
tags and through <code>hashchange</code> events. You'll still have to
pass <code>{ behavior: 'smooth' }</code> when using APIs like <code>window.scroll()</code>
unless your polyfill for these APIs has it's own CSS property check.</p>
<h4 id="hashchange-blink"><span>Scrolling triggered by <code>hashchange</code>
is not smooth in Chrome</span></h4>
<p>This actually doesn't have anything to do with this polyfill –
it's a limitation of Blink's native implementation (so it affects
other Blink-based browsers like Opera, too). While 'normal'
scrolling is smooth, if you click a couple of links and then
navigate back and forth using the browser's forwards/backwards
buttons (which triggers a <code>hashchange</code>
<h4 id="native-inconsistencies"><span>Inconsistencies in native
implementations</span></h4>
<p><b>Blink (e.g. Chrome, Opera):</b><br>
While 'normal' scrolling is smooth, if you click a couple of links
and then navigate back and forth using the browser's
forwards/backwards buttons (which triggers a <code>hashchange</code>
everytime), it jumps from anchor to anchor instead of scrolling
smoothly. If this is important to you, you can fix it by
detecting the Blink engine and force-enabling this polyfill. Load
<a href="https://github.com/isocroft/browsengine">browsengine.js</a>,
smoothly.<br>If this is important to you, you can fix it by detecting
the Blink engine and force-enabling this polyfill. Load <a href="https://github.com/isocroft/browsengine">browsengine.js</a>,
then do (<i>before</i> the polyfill runs):</p>
<pre><code>if (window.webpage.engine.blink) {
window.__forceSmoothscrollAnchorPolyfill__ = true;
<pre><code>if (window.webpage.engine.blink) {
window.__forceSmoothscrollAnchorPolyfill__ = true;
}</code></pre>
<p><b>Gecko (Firefox):</b><br>
<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=279629#c27">Anchors pointing to <code>#top</code> don't smooth scroll.</a> Use
anchors pointing at <code>#</code> for an easy fix.</p>
<h3 id="faq"><span>FAQ</span></h3>
<h4 id="ssr"><span>Will this break Server Side Rendering?</span></h4>
<p>No.</p>
Expand Down

0 comments on commit c9e15e5

Please sign in to comment.