luci-base: ui.js: rework dropdown focus behavior
authorJo-Philipp Wich <jo@mein.io>
Sun, 18 Feb 2024 22:25:55 +0000 (23:25 +0100)
committerPaul Donald <newtwen@gmail.com>
Thu, 7 Mar 2024 00:27:58 +0000 (01:27 +0100)
commitf14c04a8978e0d2b21c160bad2afd69502967d83
tree84df5dded53809dfeb90a55b78b1c39d34fea662
parent973b9a727fde1ce08bc442dcc7c7747354a63749
luci-base: ui.js: rework dropdown focus behavior

Drop mouse following focus behavior as it interferes with custom value inputs,
rely on CSS based hover effects instead.

Also slightly improve keyboard navigation by auto-focussing the custom value
input when entering the last dropdown choice via arrow down or tab key, and
by allowing to leave the text input again with the arrow up key.

Fixes: #6903
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 3980c192cda6985c2e2d2608e74677cf236005db)
modules/luci-base/htdocs/luci-static/resources/ui.js