Skip to content

DocSearch v4 modal re-opens on every keystroke after using using cmd+k + 'esc #2809

@slorber

Description

@slorber

Description

When opening the DocSearch v4 modal with cmd+k, and then closing it with 'esc, the modal will always re-open on every keystroke

It doesn't seem to happen when closing the modal by clicking the transparent overlay, but it also seems to happen if I click the modal "x" button or press 'esc'.

It also happens if we close the modal by clicking a search hit, but it doesn't happen if we use keyboard navigation and select the search hit by pressing enter.

Docusaurus bug reported: facebook/docusaurus#11572

Steps to reproduce

This reproduces on a minimal DocSearch v4 repro I created for another issue: #2804

This reproduces on the playground: https://community.algolia.com/docsearch-playground/

This reproduces on the DocSearch + Docusaurus docs websites

Expected behavior

After closing the DocSearch modal, random keyboard presses shouldn't re-open the modal

Environment

    "@docsearch/react": "^4.3.2",

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