Skip to content

Commit

Permalink
better keyboard support
Browse files Browse the repository at this point in the history
  • Loading branch information
39zde committed Oct 10, 2024
1 parent 580a50b commit 7f19f2e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function selectChildrenOf(parent, tagName) {
*/
function keyDownClicker(event) {
event.preventDefault();
if (event.key === "Enter") {
if (event.key === "Enter" || event.key === " ") {
const inputElement = selectChildrenOf(event.target, "INPUT");
if (inputElement) {
inputElement[0].click();
Expand All @@ -61,6 +61,7 @@ function keyDownClicker(event) {
*/
function cycler(selectElement) {
const options = selectChildrenOf(selectElement, "OPTION");
console.log(options)
if (options && options.includes(selectElement.value)) {
let index = options.indexOf(selectElement.value);
if (index + 1 === options.length) {
Expand Down

0 comments on commit 7f19f2e

Please sign in to comment.