Skip to content
This repository has been archived by the owner on Oct 18, 2020. It is now read-only.

Cannot initially scroll completely right in editor view #142

Closed
Poorchop opened this issue Apr 1, 2014 · 12 comments
Closed

Cannot initially scroll completely right in editor view #142

Poorchop opened this issue Apr 1, 2014 · 12 comments

Comments

@Poorchop
Copy link
Contributor

Poorchop commented Apr 1, 2014

This is assuming the demo website is using an up-to-date version of droppy (haven't tested on my server yet).

Some of the longer lines of text get cut off in the editor view. Toggling word wrap on and then off again seems to fix the problem until the page is refreshed/closed and then reopened. It looks like I can't scroll completely to the right initially.

The top of this image shows what it first looks like when I try to scroll as far right as possible. The bottom is how it appears after toggling word wrap on and then off again, and then scrolling as far right as possible.

untitled

@colelawrence
Copy link
Collaborator

Thanks for submitting, I'll take a look at it tomorrow.

What web browser are you using?
On Mar 31, 2014 9:04 PM, "PoorDog" notifications@github.com wrote:

This is assuming the demo website is using an up-to-date version of droppy
(haven't tested on my server yet).

Some of the longer lines of text get cut off in the editor view. Toggling
word wrap on and then off again seems to fix the problem until the page is
refreshed/closed and then reopened. It looks like I can't scroll completely
to the right initially.

The top of this image shows what it first looks like when I try to scroll
as far right as possible. The bottom is how it appears after toggling word
wrap on and then off again, and then scrolling as far right as possible.

[image: untitled]https://cloud.githubusercontent.com/assets/5256208/2574948/b4237c1c-b941-11e3-8712-d54a1cd6050e.png

Reply to this email directly or view it on GitHubhttps://github.com//issues/142
.

@Poorchop
Copy link
Contributor Author

Poorchop commented Apr 1, 2014

Firefox 28.0.

@silverwind
Copy link
Owner

Is Wordwrap initially enabled when you see this? Edit: Nevermind, it must've been off in this case.

Anyways, this looks like it could be a CodeMirror issue, it's just strange I've never noticed in my Firefox (I'm using versions 29 and 31).

@PoorDog: One last question: Which OS is this on?

@Poorchop
Copy link
Contributor Author

Poorchop commented Apr 1, 2014

@silverwind, I had the same issue in Firefox 28 across Windows 8.1, Fedora 20, and OS X 10.7. The first time I tried in Fedora, everything actually worked perfectly right away, but when I closed the browser, reopened, and tested again, I had the issue. There are no special steps to replicate - just open the demo page you put up, click the actions menu for a file, select edit, and try to scroll as far right as you can.

@silverwind
Copy link
Owner

Alright, thanks for the detailed explanation, really appreciate it.

@silverwind
Copy link
Owner

Ok, I can reproduce it. The issue wasn't visible to me before because I had vertical scrollbars hidden through browser-chrome. I think we need to somehow initialize/refresh CodeMirror's viewport after load, maybe it's not calculating the scrollable area correctly on initial load.

@silverwind silverwind self-assigned this Apr 1, 2014
@silverwind
Copy link
Owner

Initial testing shows that viewportMargin: Infinity renders a correct viewport, but It's obviously not something we want as the performance impact is just way too much.

@silverwind
Copy link
Owner

Funnily, when scrolling through a file like droppy.js, the horizontal scrollbar jumps around as if it wants to adjust to some of the first few rendered lines.

I'm pretty certain now that CodeMirror interprets the visible area wrongly.

@colelawrence
Copy link
Collaborator

Don't set view port infinity. That renders the entire document in Dom at
all times.
On Apr 1, 2014 10:38 AM, "silverwind" notifications@github.com wrote:

Initial testing shows that viewportMargin: Infinity renders correct
horizontal scrollbars, but It's obviously not something we want as the
performance impact is just too much.

Reply to this email directly or view it on GitHubhttps://github.com//issues/142#issuecomment-39220355
.

@silverwind silverwind removed their assignment Apr 1, 2014
@silverwind
Copy link
Owner

I'm a bit out of ideas regarding this, I checked the viewport event, and it seems to load the correct range of lines, but still, the vertical scrollbar jumps like mad when scrolling. The demo on CM's page doesn't show that behaviour. Maybe it's somehow related to our styling.

@silverwind
Copy link
Owner

I don't know what magic you worked here, but this lookes fixed!

@colelawrence
Copy link
Collaborator

I am going to guess that it might have been as simple as an
editor.refresh() at the end of the transition.
On Apr 1, 2014 3:32 PM, "silverwind" notifications@github.com wrote:

I don't know what magic you worked here, but this lookes fixed!

Reply to this email directly or view it on GitHubhttps://github.com//issues/142#issuecomment-39254877
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants