Skip to content

Commit

Permalink
Merge pull request #20561 from getusha/fix-lost-hover-effect
Browse files Browse the repository at this point in the history
Fix lost hover effect on long press and click
  • Loading branch information
puneetlath authored Jun 20, 2023
2 parents c81785f + 4e0c464 commit d43756a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Hoverable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ class Hoverable extends Component {
}
},
onBlur: (el) => {
if (!this.wrapperView.contains(el.relatedTarget)) {
// Check if the blur event occurred due to clicking outside the element
// and the wrapperView contains the element that caused the blur and reset isHovered
if (!this.wrapperView.contains(el.target) && !this.wrapperView.contains(el.relatedTarget)) {
this.setIsHovered(false);
}

Expand Down

0 comments on commit d43756a

Please sign in to comment.