Fixed capturing of keyboard events for custom elements

Co-authored-by: vtsvetkov-splunk <142901247+vtsvetkov-splunk@users.noreply.github.com>
This commit is contained in:
squidfunk 2024-01-24 10:38:32 +07:00
parent 6128ab92f2
commit be95f4901a
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF
9 changed files with 20 additions and 18 deletions

View File

@ -23,5 +23,5 @@
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
{{ super() }} {{ super() }}
<script src="{{ 'assets/javascripts/custom.054acff4.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/custom.526c59dc.min.js' | url }}"></script>
{% endblock %} {% endblock %}

View File

@ -218,7 +218,7 @@
"base": base_url, "base": base_url,
"features": features, "features": features,
"translations": {}, "translations": {},
"search": "assets/javascripts/workers/search.c011b7c0.min.js" | url "search": "assets/javascripts/workers/search.b8dbb3d2.min.js" | url
} -%} } -%}
{%- if config.extra.version -%} {%- if config.extra.version -%}
{%- set mike = config.plugins.get("mike") -%} {%- set mike = config.plugins.get("mike") -%}
@ -249,7 +249,7 @@
</script> </script>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script src="{{ 'assets/javascripts/bundle.7f914c06.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/bundle.a963951d.min.js' | url }}"></script>
{% for script in config.extra_javascript %} {% for script in config.extra_javascript %}
{{ script | script_tag }} {{ script | script_tag }}
{% endfor %} {% endfor %}

View File

@ -114,7 +114,9 @@ export function getOptionalElement<T extends HTMLElement>(
* @returns Element or nothing * @returns Element or nothing
*/ */
export function getActiveElement(): HTMLElement | undefined { export function getActiveElement(): HTMLElement | undefined {
return document.activeElement instanceof HTMLElement return (
? document.activeElement || undefined document.activeElement?.shadowRoot?.activeElement as HTMLElement ??
: undefined document.activeElement as HTMLElement ??
undefined
)
} }