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.

Trying to enter text in comment box, typing `s` causes search to grab focus, eat letter.

See original GitHub issue

Description

I added the “isso” self-administrated/serviced comment function to in place disqus and found the letter ‘s’ (also ‘S’) can’t be entered because that key causes the searchbox to grab the focus, eating the letter in the process.

I couldn’t tell you if disqus avoids this because I haven’t tried disqus.

I believe this is related to issue #400. One comment noted that s resulted in this behavior. That same commentator suggested removing attribute accesskey="s" from this element:

<input type="text" class="md-search__input" name="query" required="" placeholder="Search" accesskey="s" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query">

Indeed - that accesskey="s" attribute is now gone from that element, but the old behavior is currently present in this topic’s scenario. My background is weak but I guess it might be getting trapped by some java code. However I cannot find it.

In issue #398 “Shortcut breaks forms” it the poster was advised to in a “form”. I have tried that but it didn’t seem to work - maybe cause it is wrapping a javascript? :

<form>
<div>
<script data-isso="https://pindertek.net/isso-2/"
        src="js-isso/embed.dev.js"></script>
<section id="isso-thread"></section>
</div>
</form>

I tried this both in the main text and overriding the {% block disqus %}, no difference.

As long as I don’t type ‘s’ or ‘f’ (any others?) I can successfully send a message.

Any help would be greatly appreciated.

This really is a great piece of software - kudo to squidfunk and to the whole stack.

Description of the bug

See “description”

What you expected to happen

Plain letters typed into a text don’t cause another box to grab focus.

Actual behavior

See “description”

Steps to reproduce the bug

Go to (https://craigphicks.github.io/privca/) and scroll to bottom. Try typing ‘a’ into comment box - it works. Try typing ‘s’ into comment box - the focus changes.

Package versions

  • Python: python --version

python 3.6.7

  • MkDocs: mkdocs --version

mkdocs, version 1.0.4 (Python 3.6)

  • Material: pip show mkdocs-material | grep -E ^Version
Name: mkdocs-material
Version: 4.0.2
Summary: A Material Design theme for MkDocs
Home-page: https://squidfunk.github.io/mkdocs-material/
Author: Martin Donath
Author-email: martin.donath@squidfunk.com
License: MIT
Location: /home/craig/github/privca/mkdocs.d/pyenv/lib/python3.6/site-packages
Requires: mkdocs, Pygments, pymdown-extensions

Project configuration

# Project information
site_name: 'Server/Client 2-way Authentication w/ Private CA'
site_description: 'Step by step guide to issuing private certs for Server and Client Side Authentication - specifically *lighttpd* and *Firefox*'
site_author: 'Craig Hicks'
site_url: 'https://craigphicks.github.io/privca'

# Repository
#repo_name: 'craigphicks/privca'
#repo_url: 'https://github.com/craigphicks/privca'

# Copyright
copyright: 'Copyright &copy; Craig Hicks 2019'

# Configuration
theme:
  name: 'material'
  language: 'en'
  palette:
    primary: 'indigo'
    accent: 'indigo'
  font:
    text: 'Roboto'
    code: 'Roboto Mono'

# Customization
extra:
  manifest: 'manifest.webmanifest'
  social:
  - type: 'github'
    link: 'https://github.com/craigphicks'
# #   - type: 'twitter'
# #     link: 'https://twitter.com/squidfunk'
# #   - type: 'linkedin'
# #     link: 'https://linkedin.com/in/squidfunk'

# Google Analytics
# google_analytics:
#   - 'UA-XXXXXXXX-X'
#   - 'auto'

# Extensions
markdown_extensions:
  - attr_list
  - admonition
  - codehilite:
      guess_lang: false
  - toc:
      permalink: true

#extra:
#  disqus: 'your-shortname'

theme:
  name: 'material'
  custom_dir: 'custom'

System information

  • OS: [The operating system you’re running]

Linux ub18 4.18.0-15-generic #16~18.04.1-Ubuntu

  • Browser: [The browser used, if relevant]

Firefox 65.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
NicolasMassartcommented, Apr 5, 2019

I will test that and propose a PR if it works.

1reaction
squidfunkcommented, Apr 5, 2019

Does isContentEditable could be used instead ? https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/isContentEditable

This looks like a good candidate solution that is generic. Browser compatibility looks promising, though no data on Opera and Internet Explorer. Could you adjust the source, test it (also in those browsers), and if it works make a PR? Happy to merge.

https://github.com/squidfunk/mkdocs-material/blob/1aa8aeb2527b8d295cd4cf43816490379206bb20/src/assets/javascripts/application.js#L344-L346

And I had this page as reference https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/contentEditable stating that inherit is a possible value. I would like to prevent having to fork for my own use as I prefer to have the real release. But hotjar is widely used, so maybe it could fix the issue for some other people.

Oh, didn’t know that. Also I understand that Hotjar is widely used. As stated above - I’m happy to collaborate on a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hitting the letter T when typing causes focus to jump to and ...
Windows 10, desktop PC, when typing in MS Word or in MS Outlook, hitting the letter T causes focus jump to and open...
Read more >
4 Fixes for Comment Boxes in MS Word - Proofreading Pal
Highlight a bit of it, go up to REVIEW, click New Comment, and then type something into the comment box. (To get out...
Read more >
5.6 Note-Taking – Student Success - BC Open Textbooks
Taking notes helps you to focus your attention and avoid distractions. As you take notes in class, you will be engaging your mind...
Read more >
Healthy eating for children | nidirect
Children need a healthy balanced diet containing foods from each food group so they get a wide range of nutrients to help them...
Read more >
Remarks By President Biden on the Economy | The White House
But first, I want us to be crystal clear about the problem. There are two leading causes of inflation we're seeing today. The...
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