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

Commit 8a4f625

Browse files
ajpzwesleycho
authored andcommittedNov 27, 2016
fix(modal): revert focus behavior on open
- On open, do not focus the first focusable element Closes #6295
1 parent 7be6653 commit 8a4f625

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed
 

Diff for: ‎src/modal/modal.js

-1
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,6 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap', 'ui.bootstrap.p
646646

647647
$modalStack.modalRendered = function(modalInstance) {
648648
var modalWindow = openedWindows.get(modalInstance);
649-
$modalStack.focusFirstFocusableElement($modalStack.loadFocusElementList(modalWindow));
650649
if (modalWindow) {
651650
modalWindow.value.renderDeferred.resolve();
652651
}

Diff for: ‎src/modal/test/modal.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ describe('$uibModal', function() {
526526

527527
var modal = open({template: '<div>Content<button>inside modal</button></div>'});
528528
$rootScope.$digest();
529-
expect(document.activeElement.tagName).toBe('BUTTON');
529+
expect(document.activeElement.className.split(' ')).toContain('modal');
530530
expect($document).toHaveModalsOpen(1);
531531

532532
triggerKeyDown($document, 27);
@@ -698,7 +698,7 @@ describe('$uibModal', function() {
698698
$rootScope.$digest();
699699
$animate.flush();
700700

701-
expect(document.activeElement.tagName).toBe('INPUT');
701+
expect(document.activeElement.className.split(' ')).toContain('modal');
702702

703703
close(modal, 'closed ok');
704704

0 commit comments

Comments
 (0)
This repository has been archived.