Skip to content

[Enhancement] Tooltip Support Feature #132

@loki-mfxdev

Description

@loki-mfxdev

Hi , currently I try to integrate our component tooltip via using onReflow callback:

export const TextEllipsis = ({ textAlign = 'left', ...props }: Props) => {
 const [show, setShow] = useState<boolean>(false)

 return show ? (
   <ToolTip text={props.text} variant="guide" placement="bottomRight">
     <ResponsiveEllipsis
       css={css([ellipsisCss, { textAlign }])}
       basedOn="letters"
       onReflow={({ clamped }) => {
         if (clamped) {
           setShow(true)
         }
       }}
       {...props}
     />
   </ToolTip>
 ) : (
   <ResponsiveEllipsis
     css={css([ellipsisCss, { textAlign }])}
     trimRight
     basedOn="letters"
     onReflow={({ clamped }) => {
       if (clamped) {
         setShow(true)
       }
     }}
     {...props}
   />
 )
}

I hope our library can support tooltip when the text is clamped

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions