question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Advertise keyboard shortcut for search in text box

See original GitHub issue

Description

Add a / to right hand side of search text input element.

Screenshots / Mockups

I got the idea from Stripe docs who style this nicely IMO https://stripe.com/docs/stripe-cli/webhooks

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
squidfunkcommented, Apr 18, 2021

@weitzman Jep, that’s the one. I’d favor a modal listing all keyboard shortcuts, because it would include all, and not only the search shortcut, but up to now, I haven’t found a good way of how to integrate this with user-level custom keyboard shortcuts which some people use, as those wouldn’t show up in the modal, as described in https://github.com/squidfunk/mkdocs-material/issues/798#issuecomment-599211072. Also, other users like @Stanzilla might favor another canonical key to be displayed as the keyboard shortcut, e.g. sof f, which both work.

Other than that, what you’re aiming for is trivial with some extra CSS, i.e. you could add an ::after pseudo on the input which contains the slash, for example like this:

[data-md-toggle="search"]:not(:checked) ~ .md-header .md-search__form::after {
  position: absolute;
  top: .3rem;
  right: .3rem;
  display: block;
  padding: .1rem .4rem;
  color: var(--md-default-bg-color);
  font-weight: bold;
  font-size: .8rem;
  border: .05rem solid var(--md-default-bg-color--lighter);
  border-radius: .1rem;
  content: "/";
}

This will only display the element when the search is not active. You can easily adjust the style to your taste. As this is trivial to add with some extra CSS, I’m closing it.

1reaction
weitzmancommented, Apr 18, 2021

And now it works on mine. Sorry for the noise.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keyboard shortcuts for working with shapes, text boxes, and ...
PowerPoint ; Add another object to the selection. Shift+Spacebar ; Cancel selection of a focused item. Shift+Enter ; Move a selected item forward....
Read more >
Keyboard Shortcut for Navigating to a Text Field in Google ...
5 Answers 5 · Hit Ctrl + F to open the "Find" box. · Type what you want to find. · Hit Enter...
Read more >
Assign Keyboard Shortcut To Draw A Text Box - YouTube
In this demo, we will learn how to assign keyboard shortcut to draw a text box in MS Word 2013.
Read more >
The 33 Most Useful Keyboard Shortcuts for Google Chrome
Mac: Hold Shift and click the link. Windows PC & Linux: Hold Ctrl and Shift, then click the link. Useful Keyboard Shortcuts for...
Read more >
NVDA Keyboard Shortcuts - Deque University
Browse Mode: Browse mode is used when reading documents or web pages. Focus Mode: Focus mode is used when the user enters a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found