Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auto scrolling in Chrome #67

Merged
merged 2 commits into from Sep 25, 2019

Conversation

@MarcCote
Copy link
Contributor

MarcCote commented Sep 25, 2019

In recent Chrome versions, taking the offset/position of a 0-width and 0-height span element always returns 0. This PR changes the style of the marker lastinput so it has a nonzero offset/position.

This addresses #50 (comment).

NB: for convenience, I also included in this PR a commit with a recent build of parchment.

Quuxplusone added a commit to Quuxplusone/Advent that referenced this pull request Sep 25, 2019
@Quuxplusone

This comment has been minimized.

Copy link

Quuxplusone commented Sep 25, 2019

I tried to apply this patch to what I've got over at https://github.com/Quuxplusone/Advent/tree/gh-pages , but it seems to make my problems on Chrome even worse! Bear in mind I'm using a version of Parchment (and the corresponding Inform7-generated index.html) from 2016 and I'm probably doing something wrong. However:

Pre-patch (Quuxplusone/Advent@36e2e28), the symptom on Chrome is that the gameport doesn't autoscroll; it gets a scroll bar and you have to manually scroll down after every input.

Post-patch (Quuxplusone/Advent@9e081bf), the symptom on both Chrome and Firefox seemed to be that the gameport doesn't autoscroll and doesn't get a scrollbar! It just overflows off the bottom of the page and there's no way to see what's going on down there because you can't scroll. But then I backed my change out and reapplied it and refreshed the page, and then I couldn't reproduce that new symptom; it just went back to the old pre-patch symptom.

But I admit that my CSS is all screwed up. Maybe I'm doing something else wrong? Could I ask you to clone my repo and see if you can get it to work in Chrome?

@MarcCote

This comment has been minimized.

Copy link
Contributor Author

MarcCote commented Sep 25, 2019

@Quuxplusone

This comment has been minimized.

Copy link

Quuxplusone commented Sep 25, 2019

Awesome! I confirm that scrolling in Chrome (both on my MacBook and on my Android phone) now look much better, after applying both of those patches.

@curiousdannii curiousdannii merged commit 736aea8 into curiousdannii:master Sep 25, 2019
@curiousdannii

This comment has been minimized.

Copy link
Owner

curiousdannii commented Sep 25, 2019

Thanks!

@MarcCote MarcCote deleted the MarcCote:fix_scroll_chrome branch Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.