Skip to content

Unable to custom the width of the tooltip based on the content #783

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

Closed
ShivaniAmpati opened this issue Jun 30, 2022 · 4 comments
Closed

Comments

@ShivaniAmpati
Copy link

I would need a tooltip with some width set but unable to achieve it through classes and indeed i dont want to you use
and set multiline={true}

@lydiautkin
Copy link

+1. Would love to have a width or min-width prop for handling longer strings. The default of 20px is too small.

image

@alfianandinugraha
Copy link

I try set width like this

<ReactTooltip
  effect="solid"
  id={tooltipId}
  place={option.tooltip?.position ?? 'top'}
  overridePosition={(
    { top, left },
    currentEvent,
    currentTarget,
    node
  ) => {
    node.style.width = '190px'; // Your custom width
    return {
      top,
      left
    };
  }}
/>

Idk, but this is works for me

@danielbarion
Copy link
Member

danielbarion commented Nov 16, 2022

Hi, guys can you let me know your thoughts here, please? #820 (comment)

Also, v5 will not have this problem, but if someone can make a PR to fix v4.x, this will be great!

thanks!

@danielbarion
Copy link
Member

Hi, closing this issue due to: https://react-tooltip.com/docs/examples/styling#basic-explanation

Please, open a new one if necessary. Thanks!

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

No branches or pull requests

4 participants