Skip to content

Commit

Permalink
Fixed automatic form field switching that no longer worked with the m…
Browse files Browse the repository at this point in the history
…ouse
  • Loading branch information
jjdejong committed Jan 8, 2024
1 parent 5e87663 commit d1d3f09
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,10 @@ const handleSelectedItem = function(selectedItem, input) {
const inputs = Array.from(input.form.querySelectorAll('input:not([type="hidden"])'));
const currentIndex = inputs.indexOf(input);
const nextIndex = (currentIndex + 1) % inputs.length;
inputs[nextIndex].focus();
// Give time for the blur event to fire when using the mouse, otherwise focus() doesn't work
setTimeout( () => {
inputs[nextIndex].focus();
});
}
};

Expand Down

0 comments on commit d1d3f09

Please sign in to comment.