a11y: enter = onclick

This commit is contained in:
ed 2022-07-20 23:32:02 +02:00
parent aa98e427f0
commit bdd0e5d771
2 changed files with 6 additions and 2 deletions

View file

@ -3996,6 +3996,9 @@ document.onkeydown = function (e) {
} }
} }
if (k == 'Enter' && ae && (ae.onclick || ae.hasAttribute('tabIndex')))
return ev(e) && ae.click() || true;
if (aet && aet != 'a' && aet != 'tr' && aet != 'pre') if (aet && aet != 'a' && aet != 'tr' && aet != 'pre')
return; return;

View file

@ -40,5 +40,6 @@ for (var k in (d || {})) {
} }
tt.init(); tt.init();
if (!ebi('c')) var o = QS('input[name="cppwd"]');
QS('input[name="cppwd"]').focus(); if (!ebi('c') && o.offsetTop + o.offsetHeight < window.innerHeight)
o.focus();