Skip to content

Commit 359d50b

Browse files
authored
Update input focus when changing "page"
As the title says, I think it could be nice if the first input element could be selected (have focus) by default when changing page (msf-view).
1 parent bfd2cc0 commit 359d50b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/multi-step-form.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@
207207
var i = form.views.index(view);
208208
view.hide();
209209
form.views.eq(i + 1).show();
210+
form.views.eq(i + 1).find(':input').first().focus();
210211
}
211212
});
212213

@@ -218,6 +219,7 @@
218219
view.hide();
219220

220221
form.views.eq(i - 1).show();
222+
form.views.eq(i - 1).find(':input').first().focus();
221223
});
222224

223225
};
@@ -238,4 +240,4 @@
238240
return el.apply(this, arguments);
239241
};
240242
});
241-
}));
243+
}));

0 commit comments

Comments
 (0)