4 ms·
Do we really need this? Why won't position: absolute and setting top/left/bottom/right suffice?
by efilife 1y ago
Do we really need this? Why won't position: absolute and setting top/left/bottom/right suffice?
- adamschwartz 1y agoIt solves many of the pain points Tether[0] tried to solve. For example it helps when the anchoring element is inside of an oveflow hidden/scroll container, but geometrically you need the tethered element to sit/extend outside of the container (so—for now at least—its DOM node needs to be outside of the container). [0] https://tetherjs.dev https://tetherjs.dev
- cyral 1y agoThis always results in a ton of hacky JS to detect how the element should reposition itself if it overflows the screen (depending on the content and screen size)
- pupppet 1y agoThis relies on being able to set the position relative to a parent selector, this doesn't work if the element you are positioning is not a descendant of the element you wish to anchor to.
- bee_rider 1y agoFundamentally no, html was fine. But hey it’s one fewer reason to reach for JavaScript, right?
- netghost 1y agoYes. Unless you want to rely on JavaScript libraries like popper and FloatingUI, we definitely need this for many use cases. The simplest example is if you have content that it not contained by the box you're positioning against. Think tooltips, popovers, etc. For some usecases like annotating content, this hugely simplifies things.
- Antrikshy 1y agoThat's fine for a lot of stuff. It becomes tricky to do certain other things. CSS-only tooltips are notoriously limited in scope.