From 3d54d3419569b34c94506c6f898064ad09128a0f Mon Sep 17 00:00:00 2001 From: Amaresh S M <30730124+amareshsm@users.noreply.github.com> Date: Tue, 11 Feb 2025 21:04:34 +0530 Subject: [PATCH] docs: allow typing in search box while dropdown is open --- docs/src/assets/js/search.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/src/assets/js/search.js b/docs/src/assets/js/search.js index 913eda1ab078..2994828e3d1c 100644 --- a/docs/src/assets/js/search.js +++ b/docs/src/assets/js/search.js @@ -216,6 +216,15 @@ if (poweredByLink) { }); } +if (resultsElement) { + resultsElement.addEventListener('keydown', (e) => { + if (e.key !== "ArrowUp" && e.key !== "ArrowDown" && e.key !== "Tab" && e.key !== 'Shift') { + searchInput.focus(); + searchInput.setSelectionRange(searchInput.value.length, searchInput.value.length); + } + }); +} + document.addEventListener('keydown', function (e) { const searchResults = Array.from(document.querySelectorAll('.search-results__item')); const isArrowKey = e.key === "ArrowUp" || e.key === "ArrowDown"; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy