Skip to content

Commit aa367dc

Browse files
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 09dd8f1 commit aa367dc

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
@@ -251,8 +251,11 @@ export default {
251251
) {
252252
this.addNewEntry()
253253
} else {
254+
// Focus the next input or textarea
255+
// We have to check for both, as inputs are used for
256+
// ingredients and textareas are used for instructions
254257
$ul.children[$pressedLiIndex + 1]
255-
.getElementsByTagName("input")[0]
258+
.querySelector("input, textarea")
256259
.focus()
257260
}
258261
} else if (this.referencePopupEnabled && e.key === "#") {

0 commit comments

Comments
 (0)