Skip to content

It'd be nice if align took an array, to match positions #206

@neoncube2

Description

@neoncube2

When my popover is positioned as top or bottom, I'd like for align to be end, but when it's positioned as left or right, I'd like for it to be center.

I can set align="end", but then if the popover is shifted to the left position, I don't have an easy way to change align to be center:

<Popover
  isOpen={true}
  positions={['bottom', 'left']}
  align="end"
  content={<div>example</div>}
>
  Click me
</Popover>

I think it'd be nice if align could also take an array of alignments, which would automatically match with values in positions:

<Popover
  isOpen={true}
  positions={['bottom', 'left']}
  align={['end', 'center']}
  content={<div>example</div>}
>
  Click me
</Popover>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions