Skip to content

Popover anchor with relative div broken in 1.1.15Β #3760

@mariloufarmer

Description

@mariloufarmer

Bug report

Current Behavior

Popover does not open at anchor when using a relative div.

Image

Expected behavior

Popover should open at anchor, or at least functionality should remain the same with minor version bump.

Image

Reproducible example

CodeSandbox Template

<Popover>
  <div className="relative">
    <PopoverAnchor asChild>
      <input className="border" placeholder="just an input..." />
    </PopoverAnchor>
    <PopoverTrigger asChild className="absolute inset-y-0 right-2">
      <button className="bg-gray-200 px-1" type="button">
        Trigger
      </button>
    </PopoverTrigger>
  </div>
  <PopoverContent className="p-1 bg-gray-200" align="start">
    Content
  </PopoverContent>
</Popover>

Additional context

This bug was introduced in version 1.1.15 of @radix-ui/react-popover as it worked correctly in version 1.1.14: CodeSandbox Template

Your environment

Software Name(s) Version
Radix Package(s) @radix-ui/react-popover 1.1.15
React n/a 19.0.0
Browser chrome 142.0.7444.176
Assistive tech - -
Node n/a 20.12.0
npm/yarn/pnpm npm 10.5.0
Operating System macos 15.7.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions