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

accept null from getContent #189

Closed
wants to merge 1 commit into from
Closed

Conversation

cklab
Copy link

@cklab cklab commented Sep 9, 2016

In response to issue #186

Return null from getContent to hide tooltip.

@wwayne
Copy link
Collaborator

wwayne commented Sep 30, 2016

Good catch, but typeof null === 'object', so I've sent another PR that can support both undefined and null. #202

Anyway, thanks for your suggestion and PR 👍

@wwayne wwayne closed this Sep 30, 2016
@cklab
Copy link
Author

cklab commented Sep 30, 2016

@wwayne That's correct, and that fact is exactly why this PR works. I'm confused as to your reasoning, this and #202 are accomplishing the same exact thing...

@wwayne
Copy link
Collaborator

wwayne commented Sep 30, 2016

For the same goal but not the exact thing, I dealt with getContent and children separately and worked with a new state which introduced from previous PR to control it so that it can cover more edge cases.

No offend, but for this PR

1.it can't deal with getContent={() => { return }}
2.it can't deal with <ReactTooltip>{}</ReactTooltip>
3.it doesn't work when working with delayHide, for example

<a data-for='custom-class' data-tip='hover on me will keep the tootlip'>(・ω´・ )</a>
<a data-for='custom-class' data-tip getContent={() => { return null }}>(・ω´・ )</a>
<ReactTooltip id='custom-class' class='extraClass' delayHide={1000} effect='solid'/>

4.I think we don't need to add typeof getContent !== 'undefined', I suppose if (getContent) is enough here

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.

2 participants