Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/code/_code_block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@ export const EuiCodeBlockImpl: FunctionComponent<Props> = ({
const getCopyButton = (textToCopy?: string) => {
let copyButton: JSX.Element | undefined;

if (isCopyable && textToCopy) {
if (isCopyable) {
copyButton = (
<div className="euiCodeBlock__copyButton">
<EuiI18n token="euiCodeBlock.copyButton" default="Copy">
{(copyButton: string) => (
<EuiCopy textToCopy={textToCopy}>
<EuiCopy textToCopy={textToCopy?textToCopy:""}>
{(copy) => (
<EuiButtonIcon
size="s"
Expand Down
9 changes: 6 additions & 3 deletions src/components/inner_text/inner_text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ export function useInnerText(
// while the result of `textContent` could correctly be non-`null` due to
// differing reliance on browser layout calculations.
// We prefer the result of `innerText`, if available.
'innerText' in node
? node.innerText
: node.textContent || innerTextFallback

// 'innerText' in node
// ? node.innerText
// : node.textContent || innerTextFallback

node.textContent === null ? undefined: node.textContent
);
},
[innerTextFallback]
Expand Down