Improvement request: cursor “jumping” in editor when empty
-
Hello!
I have a small improvement request for this plugin.
When the editor is empty and you hit backspace, then the cursor does this small jump.See this image:
The first image is when backspace keydown is triggered, the second one (under the red line) is when backspace keyup is triggered.What i can see is that when the editor is visibly empty (no characters) and you push backspace, you will remove the non-visible empty p-tag inside that is re-inserted after keyup is triggered. Therefore you get this jump. This may be fixed best in JavaScript, but i made a simple CSS-fix. Is this something you find worthy of implementing? Thoughts?
// Medium editor bugfix add_action('admin_head', function(){ ?> <style type="text/css"> /* Medium Editor field normalizing bugfix */ .medium-editor-element:empty { padding-top: 8px; padding-bottom: 8px; font-size: 13px; line-height: 1.5; } .medium-editor-element > p:first-child { margin-top: 6px; } .medium-editor-element > p:last-child { margin-bottom: 4px; } </style> <?php });
Best regards, Robert Sather.
- The topic ‘Improvement request: cursor “jumping” in editor when empty’ is closed to new replies.