Skip to content

Commit

Permalink
fix clipboardcopyexpanded to work with string children
Browse files Browse the repository at this point in the history
Signed-off-by: gitdallas <dallas.nicol@gmail.com>
  • Loading branch information
gitdallas committed Oct 13, 2023
1 parent fffa82e commit 8c70f0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface ClipboardCopyState {
copied: boolean;
}

export interface ClipboardCopyProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onChange'>, OUIAProps {
export interface ClipboardCopyProps extends Omit<React.HTMLProps<HTMLDivElement>, 'onChange' | 'children'>, OUIAProps {
/** Additional classes added to the clipboard copy container. */
className?: string;
/** Tooltip message to display when hover the copy button */
Expand Down Expand Up @@ -268,7 +268,7 @@ class ClipboardCopy extends React.Component<ClipboardCopyProps, ClipboardCopySta
id={`content-${id}`}
onChange={this.updateText}
>
{this.state.text}
{this.state.text as string}
</ClipboardCopyExpanded>
)}
</React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { PickOptional } from '../../helpers/typeUtils';

export interface ClipboardCopyExpandedProps extends Omit<ClipboardCopyProps, 'onChange'> {
className?: string;
children: React.ReactNode;
onChange?: (e: React.FormEvent<HTMLDivElement>, text: string) => void;
isReadOnly?: boolean;
isCode?: boolean;
Expand Down

0 comments on commit 8c70f0f

Please sign in to comment.