aboutsummaryrefslogtreecommitdiffstats
path: root/ui/focusable.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/focusable.js')
-rw-r--r--ui/focusable.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/ui/focusable.js b/ui/focusable.js
index 942f0fed3..6b7a0b1f1 100644
--- a/ui/focusable.js
+++ b/ui/focusable.js
@@ -42,9 +42,20 @@ $.ui.focusable = function( element, hasTabindex ) {
"a" === nodeName ?
element.href || hasTabindex :
hasTabindex ) &&
- $( element ).is( ":visible" ) && $( element ).css( "visibility" ) === "visible";
+ $( element ).is( ":visible" ) && visible( $( element ) );
};
+// Support: IE 8 only
+// IE 8 doesn't resolve inherit to visible/hidden for computed values
+function visible( element ) {
+ var visibility = element.css( "visibility" );
+ while ( visibility === "inherit" ) {
+ element = element.parent();
+ visibility = element.css( "visibility" );
+ }
+ return visibility !== "hidden";
+}
+
$.extend( $.expr[ ":" ], {
focusable: function( element ) {
return $.ui.focusable( element, $.attr( element, "tabindex" ) != null );