Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto prop not acting as expected #55

Open
rijk opened this issue Dec 18, 2020 · 0 comments
Open

auto prop not acting as expected #55

rijk opened this issue Dec 18, 2020 · 0 comments

Comments

@rijk
Copy link
Contributor

rijk commented Dec 18, 2020

Take the following config:

useLayer({
  placement: 'right-center',
  possiblePlacements: [
    'right-center',
    'left-center',
    'bottom-center',
    'top-center',
  ],
  auto: false,
})

Expected result:

image

Actual result:

image

The possiblePlacements are only used when auto is set to true. This does not make sense to me, also when reading the definition of auto:

should we switch automatically to a placement that is more visible on the screen?

What I want to happen here is for useLayer to find the best position when opening the layer, but not reposition it afterwards. This way, there is no possibility to do that, because you'd always need to set auto to true.

Suggested change: make auto only control repositioning of an open layer, and initial placement always take possiblePlacements into account. If you'd not want any other positions to be selected, you just leave possiblePlacements empty right?

@rijk rijk changed the title auto prop pretty much useless as is auto prop not acting as expected Dec 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant