What does the cursorwrapper solve?

As the topic suggests, what exactly does the cursor wrapper aim to solve when you toggle bold and whatnot? This directly interferes with very delicate css rules that we’re trying to use.

I’m really really sorry if this is answered somewhere and I just dont get it. I’ve never even noticed this in the editor until it recently started showing up. One of the biggest things that makes the issue noticeable is when you toggle bold in the middle of a word, the cursorwrapper shows up and causes the browser to highlight the word for example if you have som|ething like this. It would show som and ething mispelled because you toggled bold right where the vertical bar is. I dont know how i’m going to fix this issue, I’ll probably just try to work around this. It makes it hard to write selenium tests and check for certain structures existing after doing something.

Just recently this shows up in our testing cycle, I’m shocked we haven’t seen 0xFEFF before. It broke some stuff in our PDF generation. Its hard to imagine it wasn’t there this whole time where the blame says its 1-2 years old.

To be clear, I’m just asking what this is used for. That might produce another question later, I’m just curious since the comments in the code just say something about IE, we don’t support IE though.

The cursor wrapper shows up when the marks on the text before the cursor disagree with the marks that should appear on newly typed text. It makes sure that when you type, you don’t briefly see your text appear unstyled before the editor corrects it.

There’s also some other corner cases that are handled with cursor wrappers, such as point selections appearing in non-inline contexts (as with for example the gap cursor plugin) that wouldn’t otherwise allow a cursor to be placed there.

I agree that it’s invasive and awkward (and it’s led to a fair amount of issues) but I haven’t found another solution for this. I copied this approach from CKEditor.

You probably shouldn’t be generating PDF from the editable HTML (but use the clean, exported HTML instead).

1 Like

I absolutely agree, I’ve told the developer about our output several times. But, He’s trying to leverage my paginated view. The problem I think is I need to create a serializer that serializes with the pages attached.

Thank you for this information.