Skip to content

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

Merged
dhayab merged 1 commit intonextfrom
fix/hide-empty-detached-panel-layout
Sep 14, 2023
Merged

fix(css): hide empty panel layout in detached mode#1192
dhayab merged 1 commit intonextfrom
fix/hide-empty-detached-panel-layout

Conversation

@dhayab
Copy link
Copy Markdown
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, aymeric-giraudet and sarahdayan and removed request for a team September 13, 2023 15:56
@codesandbox-ci
Copy link
Copy Markdown

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
@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