Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upExpose position prop in DotTip component #14972
Conversation
HardeepAsrani
added some commits
Nov 27, 2017
HardeepAsrani
requested review from
aduth,
ajitbohra,
gziolo,
jorgefilipecosta,
noisysocks,
talldan and
youknowriad
as
code owners
Apr 13, 2019
youknowriad
added
Good First Review
NUX
labels
Apr 15, 2019
This comment has been minimized.
This comment has been minimized.
aduth
added
the
Needs Design Feedback
label
Apr 24, 2019
mapk
requested a review
from karmatosed
Jun 25, 2019
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
The rationale was that I didn't need it so I didn't add it!
This has bitten me before too! |
noisysocks
approved these changes
Jul 4, 2019
| @@ -33,7 +34,7 @@ export function DotTip( { | |||
| return ( | |||
| <Popover | |||
| className="nux-dot-tip" | |||
| position="middle right" | |||
| position={ position || 'middle right' } | |||
This comment has been minimized.
This comment has been minimized.
noisysocks
Jul 4, 2019
•
Member
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!
This comment has been minimized.
This comment has been minimized.
aduth
Jul 5, 2019
Member
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.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
aduth
Jul 9, 2019
Member
@aduth Should I make this change then?
It would be a worthwhile improvement if you're willing, yes.
This comment has been minimized.
This comment has been minimized.
noisysocks
merged commit 99a7eb4
into
WordPress:master
Jul 11, 2019
1 check passed
This comment has been minimized.
This comment has been minimized.
|
Thanks @HardeepAsrani! |


HardeepAsrani commentedApr 13, 2019
•
edited by swissspidy
Description
This will expose the
positionprop inDotTipcomponent which usesPopovecomponent 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