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

tooltip is not working for img tag #46

Open
schel4ok opened this issue May 30, 2020 · 1 comment
Open

tooltip is not working for img tag #46

schel4ok opened this issue May 30, 2020 · 1 comment

Comments

@schel4ok
Copy link

Doing like that you will not see tooltip on mouse hover.

<img src="/storage/img/arigato.png" alt="hey tooltip" data-microtip-position="bottom" aria-label="hey tooltip" role="tooltip">

It works only for link tags like that

<a href="" data-microtip-position="bottom" aria-label="hey tooltip" role="tooltip">
<img src="/storage/img/arigato.png" alt="hey tooltip" ></a>

But documentation says you can use it on any tag

@brunormferreira
Copy link

Hi! I was with the same error, and I tried to encapsulate the element that you want to show a tooltip with a div element with the properties that need like that:

React component:

import React from 'react';

export function Tooltip({ position, label, children, ...props }) {
  return (
    <div
      data-microtip-position={position}
      aria-label={label}
      role="tooltip"
      {...props}
    >
      {children}
    </div>
  );
}

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

No branches or pull requests

2 participants