Skip to content

Incorrect caret height next to the markup placeholder in Firefox #1222

Description

@anademi

Description

In Firefox, the caret next to the placeholder in the markup editor is shorter
than the editor line height.

Image

Steps to reproduce

  1. Open the Playground story in markup mode.
  2. Select all existing content and delete it.
  3. Compare the caret height immediately after deletion and after clicking the placeholder.

Actual behavior

The caret is shorter than the line height immediately after the content is deleted.
Its height changes after clicking the placeholder.

Expected behavior

The caret should have the same height before and after clicking the placeholder,
matching its behavior in Chrome and Safari.

Environment

  • Firefox: 153.0
  • OS: macOS
  • Markdown Editor: 15.46.0

Additional context

CodeMirror places .cm-widgetBuffer before .cm-placeholder and aligns it with
vertical-align: text-top. Using vertical-align: baseline fixes the caret
metrics in Firefox.

Related Gecko issue:
https://bugzilla.mozilla.org/show_bug.cgi?id=904846

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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