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

When this page is first loaded, the code only shows up to line 11. #2707

Closed
LuckyOreo opened this issue Aug 26, 2015 · 25 comments
Closed

When this page is first loaded, the code only shows up to line 11. #2707

LuckyOreo opened this issue Aug 26, 2015 · 25 comments
Assignees

Comments

@LuckyOreo
Copy link

Challenge http://www.freecodecamp.com/challenges/waypoint-create-a-javascript-slot-machine has an issue. Please describe how to reproduce it, and include links to screenshots if possible.

When this page is first loaded, it only shows code up to line 11. The rest of the code shows up when the blank space below line 11 is clicked, or when the code area is scrolled.

@BerkeleyTrue
Copy link
Contributor

I cannot replicate. Can you post screen shots of the issue?

@BerkeleyTrue BerkeleyTrue added the status: blocked Is waiting on followup from either the Opening Poster of the issue or PR, or a maintainer. label Aug 26, 2015
@LuckyOreo
Copy link
Author

fccslotmachinebug

this was present on all slot machine challenges. This was present on Chrome Version 44.0.2403.157 m as well as IE11.

@BerkeleyTrue
Copy link
Contributor

Can you try reseting your code? (your current code will be lost)

@LuckyOreo
Copy link
Author

yeah resetting the code will display the rest of the code but if I do a refresh of the page it will behave the same where only code upto line 11 will show.

@souldreamer
Copy link
Contributor

I can confirm the issue:
screenshot 1

However, for me the text reappears if I scroll or I click on the editor where the missing code should be (but doesn't reappear if I click on the code I can see) or if I move the cursor downwards until I reach the missing code.

@bugron
Copy link
Contributor

bugron commented Aug 28, 2015

I experience this issue too!

@Daynil
Copy link

Daynil commented Aug 28, 2015

Same issue here, seems to happen when the editor has a scrollbar for overflow text.
When page first loads:

image

After scrolling around the editor or clicking on it:
image

@BerkeleyTrue BerkeleyTrue added status: discussing Under discussion threads. Closed as stale after 60 days of inactivity. and removed status: blocked Is waiting on followup from either the Opening Poster of the issue or PR, or a maintainer. labels Aug 29, 2015
@dawnvoh
Copy link

dawnvoh commented Aug 30, 2015

I also have seen this in Waypoints 18 through 21, using Chrome. I was able to press "Reset" as a workaround.
line 11

@BerkeleyTrue BerkeleyTrue added confirmed and removed status: discussing Under discussion threads. Closed as stale after 60 days of inactivity. labels Aug 31, 2015
@BerkeleyTrue
Copy link
Contributor

Thank you all for reporting. We no longer need anymore screen caps.

We need to find out where the bug lies. Could someone who is experiencing this issue spin up a local copy and step through the code in commonFramework on page load in order to pinpoint the actual cause of the issue.

It is difficult for us to actually fix something we cannot replicate.

I suspect its could be one of two things, but it may also be something else entirely.

a. It could be the codeStorage code in the begging of the commonFramework file (the code responsible for saving and pulling code out of localStorage). This would explain why reset code resolves the issue.
b. It could be a known bug in CodeMirror. We are currently using an outdate version. Could a camper search through CodeMirrors repository and find anything that might explain this?

@BerkeleyTrue BerkeleyTrue added the help wanted Open for all. You do not need permission to work on these. label Aug 31, 2015
@jbmartinez
Copy link
Contributor

The rest of the code appears after a repaint (resizing the viewport makes it appear), I guess it may be a CodeMirror problem

@BerkeleyTrue
Copy link
Contributor

It would be great if we could be certain.

@bugron
Copy link
Contributor

bugron commented Aug 31, 2015

@BerkeleyTrue try this.
commonFramework.js -> editor = CodeMirror.fromTextArea(document.getElementById('codeEditor'), change lineWrapping: true to lineWrapping: false and magic will happen... well, happened at least for me.

@dawnvoh
Copy link

dawnvoh commented Aug 31, 2015

I will tell you what I see, I hope it is helpful…

I’m in commonframework, and when I step from line 757, to line 759, that’s when the code gets displayed up to line 11.

Ok, so I started stepping INTO the functions that are being invoked between lines 757 and 759.
I’m taken to lines 2268, 2111, 2122, and eventually end up in function updateDisplayIfNeeded.

Somewhere between lines 709 and 713, the code gets displayed up to line 11. I noticed that the variable toUpdate has value 11.

@QuincyLarson
Copy link
Contributor

@bugron and I looked into fixing this with wordwrap, but it didn't work.

We think the issue is that our version of Codemirror is stale.

We need to switch to using the NPM version of Codemirrror instead of vendorizing Codemirror in our app. @BerkeleyTrue I know you mentioned your desire to do this. I think this is a priority.

@BerkeleyTrue
Copy link
Contributor

Can someone test against a newer version CodeMirror and report their findings?

@bugron
Copy link
Contributor

bugron commented Sep 8, 2015

@BerkeleyTrue I tried v5.6.1 and this is the result.

@BerkeleyTrue
Copy link
Contributor

Anyone have any insight on the root cause?

@anrddh
Copy link
Member

anrddh commented Sep 13, 2015

^ didn't work for me on localhost. Added editor.refresh() to line 196 in the commonFramework.js file. That's where it is supposed to go right?

@dawnvoh
Copy link

dawnvoh commented Sep 13, 2015

Interesting, this issue does not happen for me in the JavaScript waypoints. Just FYI in case it provides a clue.

UPDATE: Scratch that! It just happened in JavaScript waypoint 37. Some of the earlier waypoints had more than 11 lines of code, though, and it worked fine in those.

@bugron
Copy link
Contributor

bugron commented Sep 13, 2015

@BerkeleyTrue , @ahstro , @awesomeaniruddh try this. . Worked for me. The code:

$(document).ready(function() {
   editor.setOption("mode", "text/html");
   editor.refresh();
});

@BerkeleyTrue
Copy link
Contributor

Looks like we just need to add the editor.refresh() to the end of commonFramework. I remember this being somewhere in the code before but I may have been removed accidentally.

Anyone want to submit a PR?

@bugron bugron assigned bugron and unassigned BerkeleyTrue Sep 14, 2015
@bugron bugron added status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. and removed confirmed labels Sep 14, 2015
@BerkeleyTrue BerkeleyTrue removed the status: waiting review To be applied to PR's that are ready for QA, especially when additional review is pending. label Sep 15, 2015
@texas2010 texas2010 removed the help wanted Open for all. You do not need permission to work on these. label May 10, 2016
@finger563
Copy link

I'm getting this issue after moving from an older, vendorized version of CM to using the packaged version off npm. Is there any known workaround? I'm getting issues with

  • not loading all of the code/document,
  • gutter not drawing past certain line numbers when scrolling,
  • CM not scrolling when using pg-up/pg-down, and resetting the view (but not moving the cursor) when scrolling the cursor with the arrow keys past certain points (the same points which didn't initially have loaded code)

@finger563
Copy link

As an addendum, it seems to only happen when i'm placing it within a div that's configured to have height: 100%

@scipper
Copy link

scipper commented May 26, 2017

old topic, but still a problem, as I determined.

My solution was to set lineWrapping to false when mode is text/html:

before
this.htmlOptions = { lineWrapping: true }

after
this.htmlOptions = { lineWrapping: false }

that was all I had to change.

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

No branches or pull requests