Skip to content

Focus on first element of current step when changing steps #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vierkantemeter opened this issue Aug 31, 2014 · 7 comments
Closed

Focus on first element of current step when changing steps #91

vierkantemeter opened this issue Aug 31, 2014 · 7 comments
Assignees
Labels

Comments

@vierkantemeter
Copy link

I'm trying to give focus to the first form field on the current step when changing steps. As a default, the focus is on the step button, how can I change it to focus the first form field?

I tried:

onStepChanged: function (event, currentIndex, priorIndex)
{     
    $('#wizard .content :input:enabled:visible:first').focus();
}

but this isn't working unfortunately. Is this possible to accomplish?

@rstaib
Copy link
Owner

rstaib commented Aug 31, 2014

Could please you provide a JSFiddle example!

@vierkantemeter
Copy link
Author

Yes, here it is: http://jsfiddle.net/xawcn2fg/8/
I hope it's clear what I'm trying to do!
When testing the fiddle, you'll see that when you change a step, the focus is on the steps-area and not on the content field. I would like to give focus to the first focusable element on the current visible content field when changing a step.

@rstaib rstaib added the bug label Sep 1, 2014
@rstaib rstaib self-assigned this Sep 1, 2014
rstaib added a commit that referenced this issue Sep 1, 2014
@rstaib
Copy link
Owner

rstaib commented Sep 1, 2014

Fixed it! See version 1.0.8!

@rstaib rstaib closed this as completed Sep 1, 2014
@rstaib
Copy link
Owner

rstaib commented Sep 1, 2014

I recommend you to enable the following option supressPaginationOnFocus when focusing a form field inside the wizard to disable keyboard navigation in that case.

@vierkantemeter
Copy link
Author

Thank you so much Rafael for your fast help and fix! Makes this plugin even more awesome! And your tip to enable supressPaginationOnFocus is also a good one.
I'll buy you a beer :-)

@rstaib
Copy link
Owner

rstaib commented Sep 2, 2014

Thank you! I appreciate that and am pleased to hear that I could help you.

@Luizgpp
Copy link

Luizgpp commented Oct 25, 2016

Reviving topic, i'm still get this issue.

autofocus on input not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants