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

Enter key no longer selects result in local search #2935

Closed
4 tasks done
g-dx opened this issue Sep 10, 2023 · 1 comment · Fixed by #2937
Closed
4 tasks done

Enter key no longer selects result in local search #2935

g-dx opened this issue Sep 10, 2023 · 1 comment · Fixed by #2937
Labels
bug Something isn't working

Comments

@g-dx
Copy link
Contributor

g-dx commented Sep 10, 2023

Describe the bug

Commit e544b41 was merged into main and released as part of RC12.

The PR states that the search dialogue shouldn't be closed under a number of circumstances one of which is when the user presses enter.

No justification is given for this or any description of what the intended behaviour should be. This is made even more confusing given the current UI explicitly states that Enter will select the item:

image

Reproduction

Add the following Markdown files to a Vitepress site:

# Overview

Some text ...
  • Hit Ctrl + K and type "Overview".
  • Hit enter.

Expected behavior

When a user hits Enter the search dialogue should be dismissed and Vitepress should navigate to the selected entry.

System Info

System:
    OS: Linux 6.2 Ubuntu 23.04 23.04 (Lunar Lobster)
    CPU: (16) x64 Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz
    Memory: 56.57 GB / 62.54 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 18.17.1 - /usr/bin/node
    npm: 9.6.7 - /usr/bin/npm
    pnpm: 8.6.12 - ~/.local/share/pnpm/pnpm
  Browsers:
    Chrome: 116.0.5845.179
    Chromium: 116.0.5845.179
  npmPackages:
    vitepress: ^1.0.0-rc.12 => 1.0.0-rc.12

Additional context

No response

Validations

@g-dx g-dx added the bug: pending triage Maybe a bug, waiting for confirmation label Sep 10, 2023
@userquin
Copy link
Collaborator

userquin commented Sep 10, 2023

Uhmm, ok, we must also check if there is no selected index...

EDIT: you should use ESC key to close the dialog, if pressing ENTER key, the dialog SHOULD navigate to the selected index, and so, if there is no seach the dialog shouldn't be closed; you can use the ARROW UP/DOWN to navigate the search result.

@userquin userquin added bug Something isn't working and removed bug: pending triage Maybe a bug, waiting for confirmation labels Sep 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants