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

fix(uibModal): fix uibModal backdrop click bug #5321

Closed
wants to merge 1 commit into from
Closed

fix(uibModal): fix uibModal backdrop click bug #5321

wants to merge 1 commit into from

Conversation

feyy
Copy link

@feyy feyy commented Jan 21, 2016

when uibModalInstance without defining "result.then()", backdrop click not work

As the demo see, the last button opening modal without defining the modalInstance.result.then(), then the "backdrop click" doesn't work right.
Attention: Angular is v1.3.20.

when uibModalInstance without defining "result.then()", backdrop click not work
@@ -130,7 +130,9 @@ angular.module('ui.bootstrap.modal', ['ui.bootstrap.stackedMap'])
if (modal && modal.value.backdrop && modal.value.backdrop !== 'static' && (evt.target === evt.currentTarget)) {
evt.preventDefault();
evt.stopPropagation();
$modalStack.dismiss(modal.key, 'backdrop click');
$rootScope.$apply(function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of wrapping with $apply, just do

$modalStack.dismiss(...);
$rootScope.$digest()

@feyy
Copy link
Author

feyy commented Jan 21, 2016

。◕‿◕。I writed this referring to the 'Esc' key callback function.

@wesleycho
Copy link
Contributor

Just realized this was against 0.14.x - can you change your fix to be based on master and to `master?

Going to close this - the merge conflict to master is too great.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants