Skip to content

Commit

Permalink
Merge pull request #17286 from hasebsiddiqui/hasebsiddiqui-17182
Browse files Browse the repository at this point in the history
Tooltip functionality behaving weird for the copy to clipboard
  • Loading branch information
tgolen authored Apr 14, 2023
2 parents ab9b7d9 + b8d3536 commit 1138093
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/ContextMenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ class ContextMenuItem extends Component {
* Method to call parent onPress and toggleDelayButtonState
*/
triggerPressAndUpdateSuccess() {
if (this.props.isDelayButtonStateComplete) {
return;
if (!this.props.isDelayButtonStateComplete) {
this.props.onPress();
}
this.props.onPress();

// We only set the success state when we have icon or text to represent the success state
// We may want to replace this check by checking the Result from OnPress Callback in future.
Expand Down
5 changes: 5 additions & 0 deletions src/components/withDelayToggleButtonState.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export default function (WrappedComponent) {
return;
}

// Clear existing timer
if (this.resetButtonStateCompleteTimer) {
clearTimeout(this.resetButtonStateCompleteTimer);
}

this.resetButtonStateCompleteTimer = setTimeout(() => {
this.setState({
isDelayButtonStateComplete: false,
Expand Down

0 comments on commit 1138093

Please sign in to comment.