Skip to content

Popover match target width #7598

@rolfsmeds

Description

@rolfsmeds

Describe your motivation

It's fairly common to want a popover to match the width of its target (anchor) element. An example of this is a dropdown field whose dropdown should have the same width as the field itself.

While this is easy if the target has a fixed size, it's quite tricky to achieve if it doesn't.

Describe the solution you'd like

A way to set the Popover to match the width of its target, e.g. a boolean matchTargetWidth property / setMatchTargetWidth(boolean) method in Flow.

Describe alternatives you've considered

Another API solution that came to mind was to have a css property like --vaadin-popover-target-width that would be automatically set and updated by the Popover component, that could be use through the normal width property/setter.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions