Skip to content

Commit 8018247

Browse files
MarcelRobitaillechristianlupus
authored andcommitted
Enable enter to go to next instructions step (#882)
When enter is pressed in EditInputGroup, there is an attempt to select the next input field. This works for ingredients, which use inputs, but not for instructions, which use textareas. Signed-off-by: Marcel Robitaille <[email protected]>
1 parent bf5ee39 commit 8018247

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/EditInputGroup.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,11 @@ export default {
287287
) {
288288
this.addNewEntry()
289289
} else {
290+
// Focus the next input or textarea
291+
// We have to check for both, as inputs are used for
292+
// ingredients and textareas are used for instructions
290293
$ul.children[$pressedLiIndex + 1]
291-
.getElementsByTagName("input")[0]
294+
.querySelector("input, textarea")
292295
.focus()
293296
}
294297
} else if (this.referencePopupEnabled && e.key === "#") {

0 commit comments

Comments
 (0)