This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Commit 8967fd7
committed
fix($anchorScroll): make sure scrolling takes place when
When navigating to a page with a hash in the URL, Firefox and IE do their
native scrolling AFTER $anchorScroll, which cancels the applied `yOffset`.
Waiting for `document.readyState` to be 'complete' solves the problem in
Firefox.
(In IE, the issue still appears when navigating to a URL (with a hash),
but not when reloading the same URL.)
Note, that with or without this fix subsequent calls to `$anchorScroll()`
or changes to `$location.hash()` work as expected in all supported
browsers.readyState === 'complete'
1 parent 2614d4f commit 8967fd7
1 file changed
+16
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
| |||
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
237 | 252 | | |
238 | 253 | | |
239 | 254 | | |
| |||
255 | 270 | | |
256 | 271 | | |
257 | 272 | | |
258 | | - | |
| 273 | + | |
259 | 274 | | |
260 | 275 | | |
261 | 276 | | |
| |||
0 commit comments