Skip to content
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

Add Popover targetElementTag prop #2276

Merged
merged 2 commits into from
Mar 19, 2018
Merged

Add Popover targetElementTag prop #2276

merged 2 commits into from
Mar 19, 2018

Conversation

tgreen7
Copy link
Contributor

@tgreen7 tgreen7 commented Mar 19, 2018

Fixes #2250

Checklist

Changes proposed in this pull request:

With the targetElementTag prop passed to Popover or Tooltip you can change the component from a <div> to a <g> (or anything). This makes Tooltips work inside <svg>. The targetComponent prop is passed to react-popper as the component prop.

Reviewers should focus on:

Popover targetElementTag. This should be able to be a string or an JSX.Element see floating-ui/react-popper#107 but I was not sure how to get typescript to allow both.

NEED HELP: adding tests and fixing prop types to allow JSX.Element. As is solves issue #2250

@palantirtech
Copy link
Member

Thanks for your interest in palantir/blueprint, @tgreen7! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

Copy link
Contributor

@giladgray giladgray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tgreen7 sweet, glad this was easy! please rename for consistency with existing prop.

* Component element of the popover target.
* @default "div"
*/
targetComponent?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to targetElementTag to match rootElementTag, and update docs to match the existing prop.

* Component element of the popover target.
* @default "div"
*/
targetComponent?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

targetElementTag & docs (see rootElementTag immediately above)

@giladgray giladgray changed the title Adds ability to change target element for tooltips which allows them to be used inside svg Add Popover targetElementTag prop Mar 19, 2018
@giladgray
Copy link
Contributor

giladgray commented Mar 19, 2018

@tgreen7 per your description notes, i think it's preferable here to not support JSX.Element in this prop (only string) as it covers the SVG use case and we don't have to worry about JSX elements not supporting the DOM props we rely on.

@giladgray giladgray merged commit afd0939 into palantir:develop Mar 19, 2018
@tgreen7
Copy link
Contributor Author

tgreen7 commented Mar 19, 2018

@giladgray Thanks, that sounds fine.

@tgreen7
Copy link
Contributor Author

tgreen7 commented Mar 19, 2018

@giladgray How long do you think it will be before this fix gets into the release?

@giladgray
Copy link
Contributor

@tgreen7 a day or two, will be cutting full 2.0.0 this week

@tgreen7
Copy link
Contributor Author

tgreen7 commented Mar 19, 2018

@giladgray awesome thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SVGTooltip no longer exists in 2.0
3 participants