Skip to content

Problem with "copy" button functionality on EuiCodeBlock when lines end in a "?". #6585

@btychon

Description

@btychon

We use the EuiCodeBlock to display read-only scripts. There are rare cases when lines of code end in a question mark. The isCopyable attribute is applied to the component and our users press the button in the UI to copy the script contents to their clipboard. For some weird reason, when the clipboard contents are pasted into a generic text editor the "question marks" go missing... but only if they're located at the end of a line.

Adding a blank space to lines ending with "$" is a kludgy workaround.

For example:

  • Script content: a? Copy button action places a on the clipboard. <-- BUG
  • Script content: a?a Copy button action places a?a on the clipboard.
  • Script content: a? Copy button action places a? on the clipboard.

``

Metadata

Metadata

Assignees

Labels

low hanging fruitAn issue, often a bug, that is lower effort and clearly ought to be fixed

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