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

added a more robust (but succinct) e.g. of showing/hiding tooltip in readme #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matthewliuswims
Copy link

The previous e.g. for showing/hiding tooltip manually was good, but I thought could be improved, as for e.g. I was not sure what {open} was in open={open}

Also, I only realized setIsOpen() in previous e.g. worked because we were assuming a controlled component.

So my pr does the following:

  1. explicitly show that when using the prop open, we probably need a controlled component with
state = {
  open: false,
}
  1. demonstrate the ability to have a tooltip with a click trigger, which can then linger for a set amount of time (making this e.g. more practical and robust)
    setTimeout(() => alert('can do things after delay'), 2000);

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.

1 participant