Skip to content

Commit 5180e0e

Browse files
committed
Add a method to suppress keyup events
only for focused form field within the current wizard to suppress next or previous actions
1 parent 6a51ce4 commit 5180e0e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

jquery.steps.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@
219219
enableAllSteps: false, /* If true, all steps are ebable from the begining (all steps are clickable) */
220220
enableKeyNavigation: true,
221221
enablePagination: true,
222+
blockPaginationForFields: true,
222223
enableContentCache: true,
223224
enableFinishButton: true,
224225
preloadContent: false, /* Not yet implemented */
@@ -423,8 +424,13 @@
423424
$this.keyup(function (event)
424425
{
425426
var wizard = $(this);
426-
var keyCodes = { left: 37, right: 39 };
427+
if (wizard.data("options").blockPaginationForFields && $(":focus", wizard).is(":input"))
428+
{
429+
event.preventDefault();
430+
return false;
431+
}
427432

433+
var keyCodes = { left: 37, right: 39 };
428434
if (event.keyCode === keyCodes.left)
429435
{
430436
event.preventDefault();

0 commit comments

Comments
 (0)