Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG SOLVED #331

Closed
franciscocsysteames opened this issue Feb 23, 2017 · 7 comments
Closed

BUG SOLVED #331

franciscocsysteames opened this issue Feb 23, 2017 · 7 comments

Comments

@franciscocsysteames
Copy link

If on the line 1075 you add next BootstrapDialog.moveFocus(); the next code:

if ($('.modal').hasClass('in')) {
$('body').addClass('modal-open');
}

you solution the problem with scroll of the another open modals

@nakupanda
Copy link
Owner

Hi,

Can you create a demo showing the problem?

You can fork this demo: http://jsfiddle.net/o5k0eaws/1/

@franciscocsysteames
Copy link
Author

You can see the error on http://jsfiddle.net/o5k0eaws/315/

When the dialog is hidden the modal scroll brake.

but if you add

if ($('.modal').hasClass('in')) {
$('body').addClass('modal-open');
}
on the line 1075 you add next BootstrapDialog.moveFocus(); the next code:

@franciscocsysteames
Copy link
Author

sorry, try it the error http://jsfiddle.net/o5k0eaws/318/

@franciscocsysteames
Copy link
Author

this.getModal().on('hidden.bs.modal', {dialog: this}, function (event) {
var dialog = event.data.dialog;
dialog.isModalEvent(event) && typeof dialog.options.onhidden === 'function' && dialog.options.onhidden(dialog);
if (dialog.isAutodestroy()) {
dialog.setRealized(false);
delete BootstrapDialog.dialogs[dialog.getId()];
$(this).remove();
}
BootstrapDialog.moveFocus();
if ($('.modal').hasClass('in')) {
$('body').addClass('modal-open');
}

});

@nakupanda
Copy link
Owner

Thanks for the demo, now I understood.

Mixing BootstrapDialog and original method could cause that kind of problem, but which is not a BUG of BootstrapDialog I think..

@fenichelar
Copy link
Contributor

This is a major problem for us. We use Ember Bootstrap for modals with forms because it is Ember data compatible. We use this to display errors when you submit. For pages with long forms (so long modals), after an error, you can't ever scroll again. Bootstrap Dialogs (or any front end library) should not alter elements on the DOM that it didn't create, I would call this a bug.

nakupanda added a commit that referenced this issue Mar 24, 2017
@nakupanda
Copy link
Owner

@fenichelar , @franciscocsysteames

Thanks for your efforts, PR merged, new release published, you can get it here https://github.com/nakupanda/bootstrap3-dialog/releases/tag/v1.35.4

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

No branches or pull requests

3 participants