0

I have JavaScript running that somehow disables vertical panning on shown modals on mobile devices. Thus a user is not able to see all the content of a modal.

Is there a way to disable this JavaScript every time a modal is shown?

Following code in the JavaScript seems to be responsible for disabling panning:

  var my_menu = new Menu({
    menuID:"my_menu",
    menuItemClass:"menu",
  });

When I remove it panning works perfectly!

So my idea was to run another function every time a modal is shown that removes the code above.

Does that make sense & how could this be achieved?

Thanks a lot!

stevie
  • 5
  • 2

1 Answers1

0

Most of Bootstrap's JavaScript components have events you can leverage. You'd disable the script on show.bs.modal and enable it on hide.bs.modal.

I suggest that any time you use a library's features you review the entire documentation so you're aware of what it offers.

isherwood
  • 58,414
  • 16
  • 114
  • 157
  • Thanks! How would you enable / disable the script? – stevie Aug 12 '22 at 18:30
  • That's a separate question and I have no idea what `Menu()` is. It may be a simple as overwriting `my_menu` to nullify it, but the library may have a destroy function you need to use. – isherwood Aug 12 '22 at 18:58