Skip to content

[FEAT REQ] Support array of places in order of preference #1254

@mdmower-csnw

Description

@mdmower-csnw

Is your feature request related to a problem? Please describe.
It would be great if we could specify an array of preferred places in order for the tooltip to attempt to satisfy before falling back to an internally decided place. Example:

  1. When the screen is wide enough, I like place bottom.
    Image
  2. As the screen width shrinks, the tooltip automatically gets repositioned to left.
    Image
  3. I've verified bottom-end would work, though, and that would be my preference over left.
    Image

Describe the solution you'd like

Support prop place: PlacesType | PlacesType[]. If an array is passed, react-tooltip could try each in order for feasibility before falling back to its own placement decision.

Describe alternatives you've considered
For now, I settle on using bottom-end as the next best alternative.

Additional context
A similar request was made long ago in #225, but I don't understand the suggested resolution there.

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