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
Description
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 commentedon Jun 23, 2011
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 commentedon Jun 23, 2011
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!