Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahmedGaber93 Should we do this in other
onBlur
too?App/src/components/Hoverable/index.js
Lines 83 to 86 in 8f9d1c5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mollfpr yes, we should.
I think we need to check null here also to prevent this error in all places
if (!_.isNull(this.wrapperView) && !this.wrapperView.contains(el.relatedTarget))
do you agree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahmedGaber93 Sounds good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahmedGaber93 On second thought, looking and the original condition
!this.wrapperView.contains(el.relatedTarget)
, so that's mean nullthis.wrapperView
is alsotrue
?I'm not sure to understand the condition; it's either
!_.isNull(this.wrapperView) && !this.wrapperView.contains(el.relatedTarget)
_.isNull(this.wrapperView) || !this.wrapperView.contains(el.relatedTarget)
What do you guys think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mollfpr I think the two conditions will prevent call
contains
from nullthis.wrapperView
.But even though we don't have any UI visual issues, I think the second condition logic is better because it will set
isHovered
to fallback false.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahmedGaber93 Let's go with the second logic then! Sorry for the hustle 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mollfpr are you mean use
!_.isNull(this.wrapperView) &&
in the two placesor remove it from the second place here.
App/src/components/Hoverable/index.js
Lines 83 to 86 in 8f9d1c5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahmedGaber93 Only for remove it from this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mollfpr removed, you can review now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any problem if just adding this?