React Editor does not respect cursor settings


#1

I cannot stand a blinking cursor, it is way too distracting.

While using the old editor I could turn it off via styles.less with

.cursors.blink-off .cursor {
    visibility: visible !important;
}

This was global, it worked even when the editor was unfocused. With the React Editor this is not the case. When the editor is focused, the cursor does not blink, but when it is not, it does blink.

I tried to edit the following rows in cursor-view.js:

- 27 | CursorView.blinkPeriod = 800;
+ 27 | CursorView.blinkPeriod = 0;

and

- 46 |  return this.blinkInterval = setInterval(this.blinkCursors.bind(this), this.blinkPeriod / 2);

+ 46 |  // return this.blinkInterval = setInterval(this.blinkCursors.bind(this), this.blinkPeriod / 2);

without success. I am all out of ideas. How do I stop the cursor from blinking when the editor is unfocused?


#2

I’m confused. When the editor is not focused, there is no cursor. So how could it blink?


#3

Ah, that gave me a clue to the answer. Forgot to use the .is-focused class, so the cursor was forced to be visible even when the editor was not focused. Thanks for that :slight_smile:


#4

You’re welcome :smile:

I also found this in the meantime:

which corroborates your solution.