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

Panel positioning is wrong in an absolute positioned form when panelContainer is used #763

Open
salomvary opened this issue Oct 11, 2021 · 2 comments

Comments

@salomvary
Copy link
Contributor

salomvary commented Oct 11, 2021

Description

When the autocomplete form and input is placed in an absolute positioned container (eg. a modal dialog) and a custom panelContainer is used (pointing to an element in the same absolute positioned container), the panel is misplaced (towards bottom-right).

Screenshot 2021-10-11 at 16 11 22

Reproduction

Preview →.

Steps

  1. Check "Custom panelContainer" and "Positioned" checkboxes
  2. Search for something in any of the search boxes

Expected behavior

Even when custom panelContainer is used inside an absolute positioned element, the panel should be placed below the search input.

Environment

  • OS: macOS, likely not specific
  • Browser: Firefox, likely not specific
  • Autocomplete version: 1.4.0, next
@nkostadinov
Copy link

I have the same issue.

@francoischalifour
Copy link
Member

Thanks for opening the issue.

Internally we compute the top and left positions of the panel based on the search box', and apply them on the style of the element (.aa-Panel). This, no matter their parent's position.

I guess a solution would be to detect the parent's position and add the style conditionally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants