You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
``
The text was updated successfully, but these errors were encountered:
@btychon Do you think you could reproduce this in Code Sandbox? It would help us a lot to validate and debug this issue. You can get a link to a pre-populated Code Sandbox from the Demo JS tab within our docs: https://elastic.github.io/eui/#/editors-syntax/code.
@btychon Thank you for the follow up comment reporting the bug in CodeSandbox. I'm working on a fix PR for that secondary item now.
In the meantime, if you remove the second import React from 'react'; statement on line 3, and change line 5 to something like the following, it should render properly:
/* Line 5 of CodeSandbox example */constjsCode=`/* I'm an example of JS */const myObj = { key1: 1, key2: 'string value' key3: ['val', 'val2', 'val3']};`;
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:
a?
Copy button action placesa
on the clipboard. <-- BUGa?a
Copy button action placesa?a
on the clipboard.a?
Copy button action placesa?
on the clipboard.``
The text was updated successfully, but these errors were encountered: