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

Conflict with Bootstrap modal #341

Closed
dioslaska opened this Issue Aug 11, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@dioslaska
Copy link
Contributor

dioslaska commented Aug 11, 2015

"Maximum call stack size exceeded" error is thrown when mobiscroll is used in modal mode inside a Bootstrap modal window.

The bootstrap modal enforces that the focus cannot leave the modal itself. The mobiscroll popup does the same, and this causes the conflict.

As a workaround mobiscroll focus listener can be removed in the onShow event:

$('#myField').mobiscroll().date({
    onShow: function () {
        $(window).off('focusin');
   }
});

@dioslaska dioslaska modified the milestone: 2.17.0 Aug 12, 2015

@geeyan

This comment has been minimized.

Copy link

geeyan commented Aug 14, 2015

Thank you, it works!

@dioslaska

This comment has been minimized.

Copy link
Contributor

dioslaska commented Sep 4, 2015

Looks like the above workaround works only if mobiscroll is shown with animation.

Another solution is to stop the focus trap on the bootstrap modal:

$.fn.modal.Constructor.prototype.enforceFocus = function () {}; 

dioslaska added a commit that referenced this issue Sep 11, 2015

@dioslaska

This comment has been minimized.

Copy link
Contributor

dioslaska commented Oct 12, 2015

As of Mobiscroll 2.17.0 the following can be used:

$('#myField').mobiscroll().date({
    focusTrap: false  
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment