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

Fade appears to no longer work #6

Open
timmeade opened this issue Nov 11, 2021 · 0 comments
Open

Fade appears to no longer work #6

timmeade opened this issue Nov 11, 2021 · 0 comments

Comments

@timmeade
Copy link

Just installed and built first tip. Looks good, but need the fade in out.

Adding animation="fade" and the tooltip does not show at all

NextJS 11 using useState and tailwind. Everything works until adding animation="fade".

Works

import { useState } from 'react';
import Tooltip from 'react-power-tooltip';
import { PlusIcon } from '@heroicons/react/solid';

export function AddButton({ onClick }) {
  const [show, setShow] = useState(false);
  return (
    <div
      onClick={onClick ? () => onClick(true) : null}
      className="relative w-8 items-center justify-center  border border-transparent filter shadow-md p-1
                            text-base font-medium rounded-full text-purple-100 bg-purple-500 border border-color-purple-500
                            hover:bg-purple-700 hover:cursor-pointer focus:outline-none focus:ring-0 "
      // onMouseOver={() => setTimeout(() => setShow(true), 1000)}
      onMouseOver={() => setShow(true)}
      onMouseLeave={() => setShow(false)}
    >
      <PlusIcon className=" h-6 w-6" aria-hidden="true" />
      <Tooltip show={show}>
        <span className="text-sm text-purple-600 w-200 font-light">
          Add new profile
        </span>
      </Tooltip>
    </div>
  );
}

Does not work at all. Tooltip never appears.

import { useState } from 'react';
import Tooltip from 'react-power-tooltip';
import { PlusIcon } from '@heroicons/react/solid';

export function AddButton({ onClick }) {
  const [show, setShow] = useState(false);
  return (
    <div
      onClick={onClick ? () => onClick(true) : null}
      className="relative w-8 items-center justify-center  border border-transparent filter shadow-md p-1
                            text-base font-medium rounded-full text-purple-100 bg-purple-500 border border-color-purple-500
                            hover:bg-purple-700 hover:cursor-pointer focus:outline-none focus:ring-0 "
      // onMouseOver={() => setTimeout(() => setShow(true), 1000)}
      onMouseOver={() => setShow(true)}
      onMouseLeave={() => setShow(false)}
    >
      <PlusIcon className=" h-6 w-6" aria-hidden="true" />
      <Tooltip show={show} animation='fade'>
        <span className="text-sm text-purple-600 w-200 font-light">
          Add new profile
        </span>
      </Tooltip>
    </div>
  );
}
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

No branches or pull requests

1 participant