Skip to content

fix: panel position in positioned container (#763)#1336

Merged
Haroenv merged 2 commits intoalgolia:nextfrom
salomvary:fix-panel-position
Mar 5, 2026
Merged

fix: panel position in positioned container (#763)#1336
Haroenv merged 2 commits intoalgolia:nextfrom
salomvary:fix-panel-position

Conversation

@salomvary
Copy link
Copy Markdown
Contributor

Closes #763

Summary

Fix computing panel position and width when autocomplete is placed inside a positioned element.

Result

I've added an example to demonstrate the fix. It is in a separate commit so that it can easily be removed if this does not deserve a dedicated example.

yarn workspace @algolia/autocomplete-example-panel-placement-positioned start

capture

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci bot commented Mar 4, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 09abe19:

Sandbox Source
@algolia/autocomplete-example-github-repositories-custom-plugin Configuration
@algolia/autocomplete-example-instantsearch Configuration
@algolia/autocomplete-example-playground Configuration
@algolia/autocomplete-example-preview-panel-in-modal Configuration
@algolia/autocomplete-example-starter-algolia Configuration
@algolia/autocomplete-example-starter Configuration
@algolia/autocomplete-example-reshape Configuration
@algolia/autocomplete-example-vue Configuration
@algolia/autocomplete-example-panel-placement Issue #763

Copy link
Copy Markdown
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@Haroenv Haroenv merged commit 8d4b512 into algolia:next Mar 5, 2026
2 checks passed
@alcohol
Copy link
Copy Markdown

alcohol commented Mar 19, 2026

This release broke our layout..

We went from 1.19.6 rendering as
image

to 1.19.7 rendering as
image

Having trouble figuring out how to fix this though.

@Haroenv
Copy link
Copy Markdown
Contributor

Haroenv commented Mar 19, 2026

Can you share your code in a reproducible example so we can see what side effect caused this? I'm having a hard time trying to reproduce your situation @alcohol

@alcohol
Copy link
Copy Markdown

alcohol commented Mar 19, 2026

That's going to be difficult. You can find the search on https://polyestershoppen.nl (or .com for english).

But to extract this into a reproducible template.. oef.. this website is a nightmare html/css wise. Over a decade of spaghetti patching 😢

@bryantee
Copy link
Copy Markdown

@alcohol this broke our layout in the exact same way. The fix that I was able to implement was to use the same ref for the autocomplete container and panelContainer, which effectively made them siblings.

@Haroenv
Copy link
Copy Markdown
Contributor

Haroenv commented Mar 24, 2026

I've tried to reproduce and find a solution that still fixes @salomvary's original issue, but wasn't able to. If someone would like to find a solution that would work for all these use cases, I'll merge it right away :)

@alcohol
Copy link
Copy Markdown

alcohol commented Mar 26, 2026

@bryantee cheers for that! That solves our issue as well.

Haroenv added a commit that referenced this pull request Mar 30, 2026
The PRs #1338 and #1336 were very promising, but caused some regressions in positioned containers. Therefore for now i'll revert them.

@salomvary, if you could reimplement these changes, but taking the relative positioning in account, that would be ideal.

fixes #1342
Haroenv added a commit that referenced this pull request Mar 31, 2026
The PRs #1338 and #1336 were very promising, but caused some regressions in positioned containers. Therefore for now i'll revert them.

@salomvary, if you could reimplement these changes, but taking the relative positioning in account, that would be ideal.

fixes #1342
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

Successfully merging this pull request may close these issues.

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

4 participants