Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Conversation

cmcculloh-kr
Copy link

Fixes #1005
🐛 Avoid clobbering programmatically set focus
🆕 If possible, focus on the first applicable form field instead of on next/prev button if focus has not been set programmatically
💄🐎 clean up code a little to do less js processing, improve readability, and better conform to JS standards

Allowing to change or remove focus in the actionclicked callback.
This is specially important on form steps without required fields.
else {
this.$nextBtn.focus();
// only set focus if focus is still on the $nextBtn (avoid stomping on a focus set programmatically in actionclicked callback)
if( this.$nextBtn.is(":focus") ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is minor and nit-picky, but could you change this line to ':focus' instead? It'd be more consistent with how strings are defined elsewhere in the file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure thing!

@cmcculloh-kr cmcculloh-kr force-pushed the 1005---correctly-apply-focus-on-step-change-in-wizard branch from 227e941 to 3d2a9a6 Compare January 27, 2015 16:21
… or as last resort if appropriate, a non-disabled directional button
@cmcculloh-kr cmcculloh-kr force-pushed the 1005---correctly-apply-focus-on-step-change-in-wizard branch from 3d2a9a6 to 2371987 Compare January 27, 2015 16:32
@kevinparkerson
Copy link
Contributor

This looks good, although the Travis build is failing. Re-running, might need to check if something else changed that is causing this.

kevinparkerson pushed a commit that referenced this pull request Jan 27, 2015
…ocus-on-step-change-in-wizard

1005   correctly apply focus on step change in wizard
@kevinparkerson kevinparkerson merged commit 560da4c into ExactTarget:master Jan 27, 2015
@cmcculloh-kr cmcculloh-kr deleted the 1005---correctly-apply-focus-on-step-change-in-wizard branch February 6, 2015 19:09
@interactivellama interactivellama added this to the 3.6.0 milestone Feb 9, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants