From 490a7f2d9f123ae96d8fcbe9564b99adbfa2aa17 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 30 Mar 2020 17:11:07 +0200 Subject: [PATCH] Turn browser autocomplete off whan arrow is pressed Turn browser autocomplete off and use command history as soon as an arrow key is pressed allowing mobiles and tablets to keep using browser autocomplete. (#8015) --- tasmota/xdrv_01_webserver.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index 80c4bf417..ea874b7f2 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -216,6 +216,7 @@ const char HTTP_SCRIPT_CONSOL[] PROGMEM = "var hc=[],cn=0;" // hc = History commands, cn = Number of history being shown "function cH(a){" "var b=qs('#c1'),c=a.keyCode;" // c1 = Console command id + "if(38==c||40==c){b.autocomplete='off';}" // Arrow up or down must be a keyboard so stop browser autocomplete "38==c?(++cn>hc.length&&(cn=hc.length),b.value=hc[cn-1]||''):" // Arrow Up "40==c?(0>--cn&&(cn=0),b.value=hc[cn-1]||''):" // Arrow Down "13==c&&(hc.length>19&&hc.pop(),hc.unshift(b.value),cn=0)" // Enter, 19 = Max number -1 of commands in history