jodit icon indicating copy to clipboard operation
jodit copied to clipboard

Skipping a character when span has padding

Open hookedupjoe opened this issue 2 years ago • 2 comments

**Jodit Version: ** Jodit Editor v.3.19.5

Browser: Chrome OS: Windows Is React App: False

Put this HTML into the Playground editor in HTML mode, then change to UI mode <div><span style="padding:10px 10px;border:solid 1px black;">Fri Aug 26 2022</span>Testing</div>

Expected behavior: When using the right arrow inside the span, expecting it to move out of the span and to left of the T, not after the T. When moving right to left, expect when right of the T it would go to the left of the T in the word Testing.

Actual behavior: When in the span and going right, it jumps out of the span and over the T. When I move from right to left across the word Testing, it jumps over the T and into the span.

This only happens when padding is added.

hookedupjoe avatar Aug 26 '22 17:08 hookedupjoe

Hi @hookedupjoe no, this is expected behaviour. Inline elements invisible for cursor Just imagine that you have a nesting greater than 1 and the elements have no padding. you press a key, but the cursor does not visually go anywhere

text<em><strong><span>Text|</span></strong></em>For

You will have to press 3 times on the arrow to get out of this nesting. In this case, the cursor will not visually move anywhere.

xdan avatar Aug 29 '22 20:08 xdan

If I put that HTML in any other HTML editor, I can get to the letter "T". I assume that means we need to create special HTML to work correctly but I spent over a day trying to figure out what works and what does not. When I add a Semantic UI element with padding, I lose the ability to access a character due to the css padding around it. I can not help if a user wants to remove the space after what I insert, and if they do, the T is no longer accessible. If I remove the padding, it works .. not sure how that is by design, but if that is the design then I guess I'll be moving on, even though there are many genius concepts implemented in this pretty cool tool. Best of luck with your project. Cheers.

hookedupjoe avatar Aug 30 '22 11:08 hookedupjoe