-
Notifications
You must be signed in to change notification settings - Fork 1k
Tip - look at marginProp before setting adjustedMargin #7596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -54,7 +54,7 @@ const marginStyle = (theme, align, data, responsive, marginProp) => { | |||
} | |||
return edgeStyle( | |||
'margin', | |||
adjustedMargin, | |||
marginProp || adjustedMargin, |
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.
this way marginProp
that is set to 'none' will come before adjustedMargin
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.
I am comfortable with this. Upon initial review, I was wondering if theme.tip.drop.margin
should also adhere to "intelligentMargin" (which would make the margin alignment aware). In looking at the implementation of Tip, "theme.tip.drop" is passed onto Drop as a prop, so allowing for that would further complicate this logic.
Given the use case of Tip with mouseover should ideally be leaving margin as none anyway, I'm comfortable with this.
yes I looked into |
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.
Looks good!
What does this PR do?
This PR address that
tip.drop.margin
should take priority overglobal.drop.margin
currently in our hpe theme we haveglobal.drop.margin
set as well asintelligentMargin
so whats happening is those are being applied to Tip even though we havetip.drop.margin
set to "none"I have add the check that if
marginProp
is set to something then that should come before the adjustedMargin in themarginStyle
function in Drop.Where should the reviewer start?
styledDrop
What testing has been done on this PR?
locally
How should this be manually tested?
locally
in hpe theme you will see that the only margin being applied is the
theme.tip.content.margin
in which we will update this value in the hpe them to either6px
or9px
depending on discussion with designers.Do Jest tests follow these best practices?
screen
is used for querying.asFragment()
is used for snapshot testing.Any background context you want to provide?
margin
on the drop was causing the tooltip not to stay open as a user hovered from the target to the tooltipWhat are the relevant issues?
closes #7552
Screenshots (if appropriate)
Do the grommet docs need to be updated?
no
Should this PR be mentioned in the release notes?
yes
Is this change backwards compatible or is it a breaking change?
backwards compatible