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

Using the shortcut Ctrl+k to summon the search bar sometimes gets hijacked by the browser #1519

Open
ynx0 opened this issue May 20, 2022 · 3 comments

Comments

@ynx0
Copy link
Contributor

ynx0 commented May 20, 2022

Title says it all. When using the shortcut Ctrl+k, the search bar does not pop up intermittently, and instead the browser's native "search in address bar" functionality is triggered instead.

I think this has to do with focus, because Ctrl+TAB'ing away from a docs page and then navigating back reliably reproduces the behavior.

@ynx0
Copy link
Contributor Author

ynx0 commented May 20, 2022

From a cursory look, it appears that not much can be done besides e.preventDefault(), which seems to already be done here:

urbit.org/pages/_app.js

Lines 36 to 40 in 2f5f81a

const toggleSearch = (event) => {
if (event?.preventDefault) {
event.preventDefault();
}
setSearch((state) => !state);

@matildepark
Copy link
Collaborator

I think this has to do with focus, because Ctrl+TAB'ing away from a docs page and then navigating back reliably reproduces the behavior.

More or less. If you want Maximum App Feel we can do what Landscape does and implement a global hotkey.

@matildepark
Copy link
Collaborator

So, we actually do use global hotkeys — this library. As for this:

I think this has to do with focus, because Ctrl+TAB'ing away from a docs page and then navigating back reliably reproduces the behavior.

Again, can't reproduce this on Safari on Mac. It always opens Search reliably. Is this Firefox specific behaviour?

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

No branches or pull requests

2 participants