ragnarpeterson/ember-scroll-to

Pull Request #25 breaks ember-scroll-to on Chrome 61

Closed this issue ยท 5 comments

Ember-scroll-to no longer works in chrome.
The code added in PR #25 tries to normalize the targets offset top by the scrollable containers top (if the page is scrolled) and the scrollable containers current scroll position. This is necessary because the target's top is calculated from the top of the document, not its scrolling parent.

Anyhow, we want to normalize the targets offset top only when necessary.

Steps to reproduce,

  • clone the repo
  • start up the dummy app in the latest version of chrome
  • paste this code into the application.hbs, observe that it does not do what you expect.
<div style='position: fixed; top: 40px; right: 40px; color: black; background-color: lightGrey; padding: 5px;'>
  <h3 style='color: black;'>Scroll Nav Menu</h3>
  <div>
    {{#scroll-to href='body'}}
    Position TOP OF BODY
    {{/scroll-to}}
  </div>

  <div>
    {{#scroll-to href='#position-1'}}
    Position 1
    {{/scroll-to}}
  </div>

  <div>
    {{#scroll-to href='#position-2'}}
    Position 2
    {{/scroll-to}}
  </div>

  <div>
    {{#scroll-to href='#position-3'}}
    Position 3
    {{/scroll-to}}
  </div>
</div>

<div class='spacer' style='height: 400px;'>Spacer</div>
<div class='spacer' style='height: 400px;'>Spacer</div>
<div class='spacer' style='height: 400px;'>Spacer</div>

<div id='position-1' style='height: 400px; background-color: lime;'>
  Position 1 scroll destination
</div>

<div class='spacer' style='height: 400px;'>Spacer</div>
<div class='spacer' style='height: 400px;'>Spacer</div>
<div class='spacer' style='height: 400px;'>Spacer</div>

<div id='position-2' style='height: 400px; background-color: lime;'>
  Position 2 scroll destination
</div>

<div class='spacer' style='height: 400px;'>Spacer</div>
<div class='spacer' style='height: 400px;'>Spacer</div>
<div class='spacer' style='height: 400px;'>Spacer</div>

<div id='position-3' style='height: 400px; background-color: lime;'>
  Position 3 scroll destination
</div>

<div class='spacer' style='height: 400px;'>Spacer</div>
<div class='spacer' style='height: 400px;'>Spacer</div>
<div class='spacer' style='height: 400px;'>Spacer</div>

For me it didnt work in either Firefox or Chrome. Applying your PR, both are working now ๐Ÿ‘

would be awesome to have a release ;)

I don't have a publish bit for this repo, so I'll need someone else to manage this cc @ragnarpeterson .

Also, I won't be able to provide support on this repo anymore.

@blimmer @ragnarpeterson I would happily maintain this repo for a while. But I would like full access to setup Travis CI and Greenkeeper and publish to NPM.
If you want to give me al those permissions, GREAT!. If you just don't want to deal with it. You can transfer ownership to me an I can handle it.

happy to help as well... alternative way would be to fork the addon.