Bootstrap modal: background jumps to top on toggle

后端 未结 30 3417
栀梦
栀梦 2020-11-29 19:48

I have a problem, with a modal. I have a button on a page, that toggles the modal. When the modal shows up, the page jumps to top.

I have done everything I could to

30条回答
  •  伪装坚强ぢ
    2020-11-29 20:09

    I spent hours on this trying everything here and elsewhere. For angularjs-material usage, turned out I had to disable animation on the uibModal.open config object arg.

    For example:

      $uibModal.open(
        {
          animation: false,
          component: 'myDialogComponent',
          size: 'lg',
          resolve: {
            details: function() {
              return detailsCollection;
            }
          }
        }
      );
    

    Hope this helps someone else.

提交回复
热议问题