Skip to content

Cursor changes from text to default in lower part of editor input area #700

@y2onseo

Description

@y2onseo
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-text does 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 textarea but over
    a normal div, 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions