-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Expose position prop in DotTip component #14972
Conversation
Merge changes
Fix CodeEditor not loading when WordPress is installed in a subfolder…
Update the git
Merge updates
Added `position` prop to DotTip component. Closes #14923
I have done some digging into this and the reasoning isn't clear so I think based on that it should be likely to work exposing. I will cc in @noisysocks also as one of the originators of a lot of Tips code. |
The rationale was that I didn't need it so I didn't add it! 😀
This has bitten me before too! 😂 |
@@ -33,7 +34,7 @@ export function DotTip( { | |||
return ( | |||
<Popover | |||
className="nux-dot-tip" | |||
position="middle right" | |||
position={ position || 'middle right' } |
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.
You could do this with a default argument if you want to make it more explicit that the argument is optional.
export function DotTip( {
position = 'middle right',
...
} ) {
...
Totally up to you, though!
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.
You could do this with a default argument if you want to make it more explicit that the argument is optional.
I'd agree this would probably be the best way to communicate it as an optional prop, and it may help future maintainability if there are changes to the component which reference position
in more than this one location.
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.
@aduth Should I make this change then?
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.
@aduth Should I make this change then?
It would be a worthwhile improvement if you're willing, yes.
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.
@aduth Made the changes. :)
Thanks @HardeepAsrani! |
Description
This will expose the
position
prop inDotTip
component which usesPopove
component internally to make the popover.How has this been tested?
It was tested with the default DotTip that are being used for NUX. It's worth mentioning that the positioning will only take place if space is available for it (it drove me mad because I thought it wasn't working).
Checklist:
Fixes #14923