Skip to content

Firefox: Triple click + Ctrl+c in code block copies two lines instead of one #10495

@matevz

Description

@matevz

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

On Mozilla Firefox when selecting a line in the code block using a triple click, it selects it fine. But if you copy it, it copies both the line you selected and one line above. This is really annoying when copy&pasting specific lines for example in bash scripts or config files. Using triple click in normal text paragraphs works fine.

Reproducible demo

No response

Steps to reproduce

  1. Open a docusaurus website containing code blocks with multiple lines, e.g. https://docusaurus.io/docs/next/cli
  2. Select a line of code using triple-click
  3. Copy it
  4. Paste it somewhere

Expected behavior

The copied line is pasted.

Actual behavior

Two lines are pasted: The copied line and one before.

Your environment

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its execution

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions