From 787507fd9a2998c5bb59e50bef7325b0faf1d178 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sat, 3 Jan 2026 16:42:45 -0500 Subject: [PATCH 1/2] Attempt to use popover attribute in `` --- .../public/docs/5-floaty-bits/anchor-to.md | 56 +++--- .../public/docs/5-floaty-bits/floating-ui.md | 57 +++--- docs-app/public/docs/5-floaty-bits/popover.md | 182 +++++++++--------- ember-primitives/src/components/popover.gts | 34 +--- .../src/floating-ui/component.gts | 16 +- ember-primitives/src/floating-ui/modifier.ts | 56 +++++- 6 files changed, 218 insertions(+), 183 deletions(-) diff --git a/docs-app/public/docs/5-floaty-bits/anchor-to.md b/docs-app/public/docs/5-floaty-bits/anchor-to.md index 0ad795bba..738934530 100644 --- a/docs-app/public/docs/5-floaty-bits/anchor-to.md +++ b/docs-app/public/docs/5-floaty-bits/anchor-to.md @@ -2,6 +2,8 @@ The `anchorTo` modifier provides a wrapper for using [Floating UI](https://floating-ui.com/), for associating a floating element to an anchor element (such as for menus, popovers, etc). +This modifier uses the native [popover](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/popover) attribute to automatically make the intended floating element behave correctly. + The usage of a 3rd-party library will be removed when [CSS Anchor Positioning](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_anchor_positioning) lands and is widely supported (This component and modifier will still exist for the purpose of wiring up the ids between anchor and target). @@ -34,35 +36,37 @@ import { InViewport } from 'ember-primitives/viewport'; ``` diff --git a/ember-primitives/src/components/popover.gts b/ember-primitives/src/components/popover.gts index 39d5cb776..a14f7af5a 100644 --- a/ember-primitives/src/components/popover.gts +++ b/ember-primitives/src/components/popover.gts @@ -63,15 +63,6 @@ export interface Signature { * This argument is forwarded to the `` component. */ strategy?: HookSignature["Args"]["Named"]["strategy"]; - - /** - * By default, the popover is portaled. - * If you don't control your CSS, and the positioning of the popover content - * is misbehaving, you may pass "@inline={{true}}" to opt out of portalling. - * - * Inline may also be useful in nested menus, where you know exactly how the nesting occurs - */ - inline?: boolean; }; Blocks: { default: [ @@ -98,7 +89,6 @@ const Content: TOC<{ Element: HTMLDivElement; Args: { floating: ModifierLike<{ Element: HTMLElement }>; - inline?: boolean; /** * By default the popover content is wrapped in a div. * You may change this by supplying the name of an element here. @@ -117,25 +107,9 @@ const Content: TOC<{ Blocks: { default: [] }; }> = ; @@ -235,7 +209,7 @@ export const Popover: TOC =