Skip to content

Commit

Permalink
fix(Clipboard copy): Fixed regression with updating main content when…
Browse files Browse the repository at this point in the history
… expanded (#9975)
  • Loading branch information
tlabaj authored Jan 16, 2024
1 parent cec6e41 commit a189781
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class ClipboardCopy extends React.Component<ClipboardCopyProps, ClipboardCopySta
<TextInput
readOnlyVariant={isReadOnly || this.state.expanded ? 'default' : undefined}
onChange={this.updateText}
value={this.state.expanded ? this.state.textWhenExpanded : this.state.text}
value={this.state.text}
id={`text-input-${id}`}
aria-label={textAriaLabel}
{...(isCode && { dir: 'ltr' })}
Expand All @@ -266,7 +266,7 @@ class ClipboardCopy extends React.Component<ClipboardCopyProps, ClipboardCopySta
textId={`text-input-${id}`}
aria-label={hoverTip}
onClick={(event: any) => {
onCopy(event, this.state.expanded ? this.state.textWhenExpanded : this.state.text);
onCopy(event, this.state.text);
this.setState({ copied: true });
}}
onTooltipHidden={() => this.setState({ copied: false })}
Expand Down

0 comments on commit a189781

Please sign in to comment.