AntiEvictionBoston / Maps

Maps highlighting eviction and displacement in Boston, using leaflet.js and React.
GNU Affero General Public License v3.0
6 stars 0 forks source link

scroll stories up automatically when switching #85

Open alicewriteswrongs opened 8 years ago

alicewriteswrongs commented 8 years ago

we can do this pretty easily by putting an empty div as the first child of story-content-wrapper and then calling .scrollIntoView() on that element whenever our component updates.

closes #84

alicewriteswrongs commented 8 years ago

@heybenji this fixes #84, do you want to take a look? it's a pretty quick change.

alicewriteswrongs commented 8 years ago

it will happen on any device width (not just mobile)

heybenji commented 8 years ago

Will pull momentarily and check out. I think it's great it happens on all devices.

On Mar 16, 2016, at 8:12 AM, Alice notifications@github.com wrote:

it will happen on any device width (not just mobile)

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub

alicewriteswrongs commented 8 years ago

@heybenji I'm going to delete that merge commit and update this pr, just FYI

heybenji commented 8 years ago

Hey so unfortunately this has a weird consequence of scrolling the entire page up and causing the map to be obscured significantly by the location bar in iOS. Not sure what the behavior is in Android.

I'm wondering if this has to do with scrollIntoView() not quite getting that we're scrolling not the page but an element within another element?

See what the story should look like:

simulator screen shot mar 16 2016 9 59 12 am

vs what it looks like after arrowing into it (and triggering the scrollIntoView()).

I can't really trouble-shoot it at the moment. Need to put in a full day of work today, but ultimately this isn't a huge blocking issue and can hang out.

simulator screen shot mar 16 2016 9 57 01 am

heybenji commented 8 years ago

@aliceriot don't merge yet. :-)

alicewriteswrongs commented 8 years ago

@heybenji oh haha, no I wasn't going to merge I was just going to delete the Merge branch master commit.

I can poke around and see how this behaves on Android, I was just testing it in the browser.

heybenji commented 8 years ago

Also @aliceriot sorry about doing that merge. I saw the FB SDK cleanup wasn't in this branch so got over-excited for your spring cleaning.

alicewriteswrongs commented 8 years ago

:smile: no worries

alicewriteswrongs commented 8 years ago

I think this is something that I'd like to put some time into figuring out the right solution, something that cleanly scrolls up just that div and works on all platforms and so on.

In my view this is something we'd like to fix soon but it's not like an 'on fire' kind of situation, so if I can't figure something out through researching I might open a stack overflow question or something along those lines.

heybenji commented 8 years ago

Yeah I think it can hang out until the right solution presents itself.