Cursor jumps when clicking on a worksheet for the first time

62 views
Skip to first unread message

Aaron Tresham

unread,
Nov 3, 2016, 2:07:28 PM11/3/16
to sage-cloud
Every time I click on a newly opened sage worksheet, the cursor appears several lines below where I clicked. This usually results in the page scrolling down, so to get to the place I want I have to scroll back up and click again.

This only happens the first time I click on a worksheet; after that the cursor appears in the line I click on.

Not a huge issue, but it's really irritating, since I happens every time I open a worksheet.

Is this a known issue? Could it be browser-specific (I use Chrome)?

Thanks,

Aaron

William Stein

unread,
Nov 3, 2016, 2:35:37 PM11/3/16
to sage-cloud
I've never experienced this issue, nor has anybody ever reported it.
I also use Chrome.

What happens when you disable absolutely all browser extensions?

Does the problem happen with all worksheets?

Does it happen when editing other types of files, e.g., foo.md?

Does it happen on the plain codemirror demo here:

http://codemirror.net/demo/theme.html

William

>
> Thanks,
>
> Aaron
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-cloud" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-cloud+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sage-cloud/a974d01d-4a89-4f3b-ab2a-d0d8491c7002%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--

Best Regards,
William Stein

CEO, SageMath, Inc.

Aaron Tresham

unread,
Nov 3, 2016, 2:57:13 PM11/3/16
to sage-cloud
I have to go to class soon, but I'll test it out later today and let you know.

Aaron

Aaron Tresham

unread,
Nov 4, 2016, 1:51:10 PM11/4/16
to sage-cloud
I have more testing to do, but this is what I have found so far:

The cursor jump does not occur with every Sage worksheet. It seems to be limited to worksheets that have a lot of text cells (%md). When I load such a worksheet, there is a little lag while all the text renders. Then the cursor jumps when I click.

For shorter worksheets, I do not have the same problem. I will test some more to see if it just the length of the worksheet or if it's specifically the amount of text that makes a difference. I will also test different file types.

Aaron

William Stein

unread,
Nov 4, 2016, 2:05:28 PM11/4/16
to sage-cloud
On Fri, Nov 4, 2016 at 10:51 AM, Aaron Tresham <atre...@gmail.com> wrote:
> I have more testing to do, but this is what I have found so far:
>
> The cursor jump does not occur with every Sage worksheet. It seems to be
> limited to worksheets that have a lot of text cells (%md). When I load such
> a worksheet, there is a little lag while all the text renders. Then the
> cursor jumps when I click.
>
> For shorter worksheets, I do not have the same problem. I will test some
> more to see if it just the length of the worksheet or if it's specifically
> the amount of text that makes a difference. I will also test different file
> types.
>

If you can replicate this, create a github issue and include or link
to a public worksheet that others can use to replicate it.

https://github.com/sagemathinc/smc/issues
> https://groups.google.com/d/msgid/sage-cloud/015b9d04-7f97-4b81-b140-cd89f460e856%40googlegroups.com.

Aaron Tresham

unread,
Nov 4, 2016, 7:01:37 PM11/4/16
to sage-cloud
OK, I will do this.

By the way, does anyone know what determines the cursor's initial position when a Sage worksheet is opened? Is that controlled by the browser or by Sage?

Thanks,

Aaron

William Stein

unread,
Nov 4, 2016, 7:34:31 PM11/4/16
to sage-...@googlegroups.com


On Friday, November 4, 2016, Aaron Tresham <atre...@gmail.com> wrote:
OK, I will do this.

By the way, does anyone know what determines the cursor's initial position when a Sage worksheet is opened? Is that controlled by the browser or by Sage?

 Browser.  It is restored from the last state as saved in local storage. 
To unsubscribe from this group and stop receiving emails from it, send an email to sage-cloud+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud/f13cd370-e92c-4838-aa72-8df03da3d1c4%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Aaron Tresham

unread,
Nov 6, 2016, 9:38:44 PM11/6/16
to sage-cloud
Before I make a github issue, I would like to share my observations. This may be a browser issue.

When I open a Sage worksheet with lots of text output, then many of those output cells appear as a single blank line when the worksheet is first opened, and then the actual output will show up as the browser processes things. Since this output is usually longer than one line, rendering the actual output results in later parts of the page being moved down. (Plots may cause similar behavior, since they are often delayed as well, but I didn't check this extensively).

When I click on an early line (above the point where any shifting has occurred), then the cursor appears right where I clicked. However, if I click on a later line, then the cursor will jump several lines below where I click. It appears that the jump size increases as I go further down the page. It may be (but I'm not sure) that the amount of jump depends on the size of the shift resulting from the rendered output.

This only happens on the first such click. After this, everything works as expected.

I also noticed that the original cursor position also shifts. For example, if I have the cursor on line 100 when I close the worksheet, then when I re-open the worksheet the cursor begins at line 100. But then line 100 gets shifted down the page due to output above that showing up. Instead of the cursor staying with line 100 as it moves, the cursor stays in the same spot. So as the lines move down, the cursor may end up in line 90; it may even end up in the middle of an output cell.

I don't know if this issue is caused by the browser (I tried both Chrome and MS Edge), or if it has to do with my connection speed (my ping times are 100-125ms on a good day - is that typical?).

Here is an example of the kinds of worksheets I use:



I will create a github issue if you think something can be done from the SMC side. This is not a high priority, just an irritation at this point.

Thanks,
Aaron

William Stein

unread,
Nov 6, 2016, 9:51:40 PM11/6/16
to sage-...@googlegroups.com
Yes, please create an issue.  These are exactly the sorts of little nuisance issues that I desperately want to fix at this point in the evolution of SMC (we have actually fixed most known SMC bugs at this point...)
--
You received this message because you are subscribed to the Google Groups "sage-cloud" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-cloud+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud/c2905388-2300-4a85-9648-85c5114fe4d7%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Aaron Tresham

unread,
Nov 7, 2016, 1:32:33 AM11/7/16
to sage-cloud
OK, issue created.

Thank you, as always, for your quick response!

Aaron

Samuel Lelièvre

unread,
Nov 8, 2016, 3:25:32 AM11/8/16
to sage-cloud


Mon 2016-11-07 07:32:33 UTC+1, Aaron Tresham:
OK, issue created.


Reply all
Reply to author
Forward
0 new messages