Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | ctoolsModalFocusIE8-1803420-1.patch | 618 bytes | Ilyna |
Comments
Comment #1
Ilyna CreditAttribution: Ilyna commentedHere is a followup for this bug. The patch works for us.