Skip to content

Search app searchbar disappearing #199

@Ducica

Description

@Ducica

Package version (if known):Latest

Describe the bug

Search bar disappears from the search app

Steps to Reproduce

Reduce the screen size so that the facets sidemenu would get hidden. Open the facets side menu, then close the side menu. The search bar disappears both from the page header as well as from the right hand side menu that contains the side bar on smaller screens (actually it disappears as soon as you open the facets menu).

Expected behavior

The search bar should still be in the UI

Screenshots (if applicable)

image

The problem is that facet sidebar handler is on the top level of the searchapp layout
const [sidebarVisible, setSidebarVisible] = React.useState(false);

When you open the facet sidebar, the app rerenders, but the node where the search bar tries to portal itself to does not exist in the dom currently (as it is hidden on smaller screens).

The solution is to put the facet sidebar state below the searchbar, so it does not get rerendered when facet sidebar is toggled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions