I've found this problem when dealing with ctools modals and Internet Explorer 8, it's throwing this error:

"Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus."

in this line:

if ( $('#modalContent')) $('#modalContent').get(0).focus();

Looking around, it seems is a "well known" thing from Internet Explorer and there are some workarounds

I'm putting here the fix implemented, but not sure it's the best thing to do, replacing the line above by

      if ( $('#modalContent')) {
        setTimeout(function() {
          $('#modalContent').get(0).focus();
        }, 10);
      }

If it's ok to add a 10ms wait so that lazy IE can catch up, I'll post a patch with it.

CommentFileSizeAuthor
#1 ctoolsModalFocusIE8-1803420-1.patch618 bytesIlyna
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ilyna’s picture

Here is a followup for this bug. The patch works for us.