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

[doc] Search - focus with Ctrl+K keyboard shortcut #933

Open
hakenr opened this issue Nov 10, 2024 · 0 comments
Open

[doc] Search - focus with Ctrl+K keyboard shortcut #933

hakenr opened this issue Nov 10, 2024 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@hakenr
Copy link
Member

hakenr commented Nov 10, 2024

Inspiration

    const handleCk = (event: KeyboardEvent) => {
      if (event.ctrlKey || event.metaKey) {
        if (event.key?.toLowerCase() === "k") {
          event.preventDefault();
          inputRef.current.focus();
        }
      }
    };

    window.addEventListener("keydown", handleCk);

    return () => {
      window.removeEventListener("keydown", handleCk);
    };

We should add some UX hint, such as
image

(Might be customized to Cmd+K on MacOS.)
image

We might consider adding support for keyboard shortcut to HxSearchBox (search in doc might be ported to HxSearchBox instead of current HxAutosuggest implementation).

@hakenr hakenr added the documentation Improvements or additions to documentation label Nov 10, 2024
@hakenr hakenr added this to the Priority 2 - Normal milestone Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant