https://jsfiddle.net/e6x4hq9h/
打开第一个模态.它打开很好.删除背景滚动条.
从该模态中打开模态.它会导致滚动转到背景.
我搜索了其他解决方案,似乎没有人解决这个问题.我尝试了这个页面上的所有内容:Bootstrap模式:关闭当前,打开新的等等.
使用Javascript:
// Only one of these modals should show at a time.
$('#myModal2').on('show.bs.modal', function (e) {
$('#myModal').modal('hide');
})
.on('hide.bs.modal', function (e) {
$('#myModal').modal('show');
});
Run Code Online (Sandbox Code Playgroud)
更新:第一个和第二个模式也必须允许滚动,如在这个小提琴中可以看到:https://jsfiddle.net/e6x4hq9h/21/
我使用"@material-ui/core": "^3.9.3"与"@material-ui/pickers": "^3.0.0-beta.1"
当我从中导入任何内容时,@material-ui/pickers都会得到:
Uncaught TypeError: Object(...) is not a function
at Module../node_modules/@material-ui/pickers/dist/material-ui-pickers.esm.js (material-ui-pickers.esm.js:25)
at __webpack_require__ (bootstrap:781)
at fn (bootstrap:149)
at Module../src/views/Event/Create.js (User.js:18)
at __webpack_require__ (bootstrap:781)
at fn (bootstrap:149)
at Module../src/Routes.js (Routes.js:1)
at __webpack_require__ (bootstrap:781)
at fn (bootstrap:149)
at Module../src/layouts/Admin.jsx (index.js:73)
at __webpack_require__ (bootstrap:781)
at fn (bootstrap:149)
at Module../src/index.js (index.css?02e3:45)
at __webpack_require__ (bootstrap:781)
at fn (bootstrap:149)
at Object.0 (Notifications.jsx:300)
at __webpack_require__ (bootstrap:781)
at checkDeferredModules (bootstrap:45)
at Array.webpackJsonpCallback [as push] (bootstrap:32)
at main.chunk.js:1
Run Code Online (Sandbox Code Playgroud)