Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

fix(modal): stop IE throwing exception on focus #5097

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/modal/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap'])
if (elementToReceiveFocus && elementToReceiveFocus.focus) {
elementToReceiveFocus.focus();
} else {
appendToElement.focus();
if(appendToElement.focus) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably better put on the else, i.e.

else if (appendToElement.focus) {
  appendToElement.focus();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes, good point indeed. completely overlooked that after console.log debugging i guess

appendToElement.focus();
}
}
}

Expand Down