gluestack / gluestack-ui

React & React Native Components & Patterns (copy-paste components & patterns crafted with Tailwind CSS (NativeWind))
https://gluestack.io/
MIT License
2.43k stars 116 forks source link

Tooltip long text are overflow #1655

Open ArjunKarki opened 8 months ago

ArjunKarki commented 8 months ago

Description

if the placement is top right it should start from right and come to left, but currenttly half of the context is hide and go through the screen.

CodeSandbox/Snack link

No response

Steps to reproduce

  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error

gluestack-ui Version

1.0.34

Platform

Other Platform

No response

Additional Information

No response

rajat693 commented 8 months ago

hi @ArjunKarki, Thanks for reporting the issue. You can resolve this by giving the width to TooltipContent as mentioned below. <TooltipContent w={220}> {content} </TooltipContent>

ArjunKarki commented 8 months ago

Hi, @rajat693 I tried, still it is oveflow and go beyong the screen , My text is "This is the very very long long tooltip content text". I put placement to "top right"

Screenshot 2024-01-18 at 6 04 09 pm
rajat693 commented 8 months ago

Could you please share the code with us, @ArjunKarki? This will help us better understand your issue and reproduce it more effectively.

ArjunKarki commented 8 months ago
 <Tooltip
                closeDelay={1000}
                placement="top right"
                isOpen={openTooltip}
                onClose={() => setOpenTooltip(false)}
                trigger={triggerProps => {
                  return (
                    <Pressable {...triggerProps} onPressIn={visibleTooltip}>
                      <HStack alignItems="center">
                        <IconButton
                          {...triggerProps}
                          helpCircleIcon
                          iconColor={'$gray900'}
                          pl={'$1'}
                          pr="$0"
                          onPressIn={visibleTooltip}
                          ref={null}
                        />
                      </HStack>
                    </Pressable>
                  );
                }}>
                <TooltipContent>
                  <TooltipText  fontSize="$tsm">
This is the very very long long tooltip content tex
                  </TooltipText>
                </TooltipContent>
              </Tooltip>
            )}

@rajat693 Here is the code that I applied, if the text is long, 60% of the tooltip is overflow and hidden as the SS shown above.