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

fix(css): hide empty panel layout in detached mode #1192

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

dhayab
Copy link
Member

@dhayab dhayab commented Sep 13, 2023

Summary

In detached mode, typing a query that returns no results and for which the source does not include a noResults template shows an empty element with odd vertical space.

This is because shouldPanelOpen always returns true in detached mode, and while empty, the panel layout element has padding, which causes the issue.

This PR hides this element if it does not have children.

Before

CleanShot 2023-09-13 at 17 49 57@2x

After

CleanShot 2023-09-13 at 17 51 15@2x

Fixes #1191

@dhayab dhayab requested review from a team, sarahdayan and aymeric-giraudet and removed request for a team September 13, 2023 15:56
@codesandbox-ci
Copy link

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 98c5042:

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-react-renderer Configuration
@algolia/autocomplete-example-starter-algolia Configuration
@algolia/autocomplete-example-starter Configuration
@algolia/autocomplete-example-reshape Configuration
@algolia/autocomplete-example-vue Configuration
dont-open-dropdown Issue #1191

@dhayab dhayab merged commit 973feaf into next Sep 14, 2023
9 checks passed
@dhayab dhayab deleted the fix/hide-empty-detached-panel-layout branch September 14, 2023 09:19
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.

In detached mode when there are no items, the dropdown still appears
3 participants