compound-web
f7c8e04c - feat(Tooltip): add boundary prop to hide tooltip when it escapes an element

Commit
14 days ago
feat(Tooltip): add boundary prop to hide tooltip when it escapes an element Adds an optional 'boundary' prop to useTooltip/Tooltip that activates FloatingUI's 'hide' middleware with strategy='escaped'. When the tooltip would overflow the boundary, it gets the 'invisible' class (clip-path: inset(50%)) so it remains in the DOM for screen readers but is visually hidden. The boundary is also passed to the 'flip' middleware so the initial placement is more likely to stay inside it. This lets consumers like Element Web keep the 'Expand map' tooltip on location messages from overlapping the message composer at the bottom of the timeline.
Author
Parents
Loading