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

Provide Option to focus on page #1909

Closed
@trainiac

Description

@trainiac

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();
        }
    }
}

Activity

toddparker

toddparker commented on Jun 23, 2011

@toddparker
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

trainiac commented on Jun 23, 2011

@trainiac
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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @trainiac@toddparker

        Issue actions

          Provide Option to focus on page · Issue #1909 · jquery-archive/jquery-mobile