Simulating a comparator circuit
The problem is that a comparator's output swings between the positive voltage rail and negative voltage rail (more or less). If you use an op amp without voltage rails in CircuitLab, it doesn't know what these values should be, so it defaults to something like +/- 50V. This, of course, messes up your circuit, causing the crazy voltage swings you see in your second image. (The large default makes sense for a typical op amp circuit, which won't get near saturation. But for a comparator circuit, it's bad.)

The solution is to use "op amp with voltage rails", and connect it to a +1V source and ground. Then the comparator outputs 0 or 1V and everything works as expected.