-
-
Notifications
You must be signed in to change notification settings - Fork 197
Description
test.mp4
Description
I’m experiencing an inconsistent cursor behavior inside the editor input area.
In the upper part of the editor, the cursor is a text cursor (I-beam),
but in the lower part it switches to the default arrow cursor,
even though both areas appear to be part of the same editable region.
I don’t have any cursor-related styles or logic applied on my side.
Analysis
After inspecting the DOM and CSS, this seems to be related to how the editor
input is structured with multiple layers.
- The actual input
textarea(.w-md-editor-text-input) is positioned
absolutely inside.w-md-editor-text. - The scroll/layout container (
.w-md-editor-area.w-md-editor-input)
can be taller than.w-md-editor-text. - When
.w-md-editor-textdoes not fill the full height of the input area,
a blank area remains at the bottom. - In that bottom area, the mouse is no longer over the
textareabut over
a normaldiv, so the browser shows the default cursor instead of the
text cursor.
So the cursor changes depending on which DOM element is under the mouse:
- Upper area: textarea → text cursor
- Lower area: div → default cursor
Temporary workaround (what I did)
Wrapping the editor with a parent element that sets cursor: text fixes the issue:
<div style={{ cursor: "text" }}>
<MDEditor
data-color-mode="light"
height={408}
value={commentValue}
onChange={(v) => setCommentValue(v)}
preview="edit"
/>
</div>Request
Could this be fixed on the library side?
The textarea (or .w-md-editor-text) covering the full input area
would likely prevent this issue.