floating-ui icon indicating copy to clipboard operation
floating-ui copied to clipboard

`inline` middleware

Open atomiks opened this issue 3 years ago • 0 comments

Problem

When wanting to position a floating element on an inline element that spans over two or more lines, the positioning is not desirable because getBoundingClientRect() measures over the whole box, not each individual inline rect.

Solution

It's possible to do this via a Virtual Element but a middleware would be better.

e.g. https://github.com/atomiks/tippyjs/blob/60aee16c934fc861569f84a37c6a1a7f42a33fa0/src/plugins/inlinePositioning.ts#L112

atomiks avatar Dec 04 '21 01:12 atomiks