-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
IPopoverSharedProps used by Popover and Tooltip, some prop renames #2617
Conversation
export popoverSharedProps, fix ContextMenuPreview: documentation | landing | table |
@@ -13,7 +13,8 @@ import * as Classes from "../../common/classes"; | |||
import { Position } from "../../common/position"; | |||
import { safeInvoke } from "../../common/utils"; | |||
import { IOverlayLifecycleProps } from "../overlay/overlay"; | |||
import { Popover, PopperModifiers } from "../popover/popover"; | |||
import { Popover } from "../popover/popover"; | |||
import { PopperModifiers } from "../popover/popoverSharedProps"; |
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.
thoughts on the best place for this symbol to live?
add upgrade script entriesPreview: documentation | landing | table |
@@ -0,0 +1,140 @@ | |||
/* |
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.
not sure about conventions here but this file doesn't need to be a tsx
file.
import { IOverlayableProps } from "../overlay/overlay"; | ||
|
||
// re-export this symbol for library consumers | ||
export { PopperModifiers }; |
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.
seems fine to live here
* The target element to which the popover content is attached. | ||
* This can instead be provided as the first `children` element. | ||
* The target to which the popover content is attached. This can instead be | ||
* provided as the _first_ element in `children`. | ||
*/ | ||
target?: string | JSX.Element; |
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.
Why are content
and target
not also shared?
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'll notice they work differently. Tooltip
does not support a target
prop (passed via children) and it requires content
prop.
i guess they could be unified... thoughts?
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 a reason for the API difference even though behavior is the same?
In pr [palantir#2617](palantir#2617 the type of the `onInteraction` prop was [changed](palantir@f111cdc#diff-526f9b7061d074b106ee2b67a5dafc14L122) to no longer include the event as the second argument (added as part of [palantir#2340](palantir#2430)). However the the code still [conforms to the previous interface](https://github.com/palantir/blueprint/blob/9728e61b420eda381cedce06166a4caf6b958bc4/packages/core/src/components/popover/popover.tsx#L501). All I've done is change it back to what it was 🙂
pulling out the renames from #2609 and unifying the props interfaces between Popover and Tooltip.
Changes proposed in this pull request:
IPopoverSharedProps
for the common Popover/Tooltip bitsrootElementTag
=>wrapperTagName
targetElementTag
=>targetTagName
tooltipClassName
=>popoverClassName