Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Provide Option to focus on page #1909

Closed
trainiac opened this issue Jun 23, 2011 · 2 comments
Closed

Provide Option to focus on page #1909

trainiac opened this issue Jun 23, 2011 · 2 comments

Comments

@trainiac
Copy link

It would be nice if you could decide for your own code page by page whether you want it to do this auto focus logic.

//direct focus to the page title, or otherwise first focusable element

 function reFocus( page ) {
   var lastClicked = page.jqmData( "lastClicked" );

    if( lastClicked && lastClicked.length ) {
        lastClicked.focus();
    }
    else {
        var pageTitle = page.find( ".ui-title:eq(0)" );

        if( pageTitle.length ) {
            pageTitle.focus();
        }
        else{
                           page.find( focusable ).eq( 0 ).focus();
        }
    }
}
@trainiac trainiac reopened this Jun 23, 2011
@toddparker
Copy link
Contributor

Would this be so you could write your own focus logic to replace this? It's critical to manage focus between pages because otherwise, you could be focused on a page that isn't in view and that's bad for using the roller on Android or Blackberry. ALso needed for screenreaders.

@trainiac
Copy link
Author

I see. Yes, I would like to have this as a default but also have the ability to override it on a page by page basis. Thanks for the info and you guys are champs!

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

No branches or pull requests

2 participants