mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:48:55 +08:00
优化弹框样式
This commit is contained in:
parent
633cd09384
commit
72e5fcf490
@ -1,6 +1,9 @@
|
||||
.is-modalOpened {
|
||||
overflow: hidden;
|
||||
padding-right: px2rem(15px);
|
||||
|
||||
&.has-scrollbar {
|
||||
padding-right: px2rem(15px);
|
||||
}
|
||||
|
||||
.#{$ns}Modal {
|
||||
overflow-x: hidden;
|
||||
|
@ -84,6 +84,9 @@ export class Drawer extends React.Component<DrawerProps, DrawerState> {
|
||||
|
||||
handleEnter = () => {
|
||||
document.body.classList.add(`is-modalOpened`);
|
||||
if (document.body.scrollHeight > window.innerHeight) {
|
||||
document.body.classList.add(`has-scrollbar`);
|
||||
}
|
||||
};
|
||||
|
||||
handleEntered = () => {
|
||||
@ -95,8 +98,10 @@ export class Drawer extends React.Component<DrawerProps, DrawerState> {
|
||||
document.activeElement && (document.activeElement as HTMLElement).blur();
|
||||
onExited && onExited();
|
||||
setTimeout(() => {
|
||||
document.querySelector('.amis-dialog-widget') ||
|
||||
if (!document.querySelector('.amis-dialog-widget')) {
|
||||
document.body.classList.remove(`is-modalOpened`);
|
||||
document.body.classList.remove(`has-scrollbar`);
|
||||
}
|
||||
}, 200);
|
||||
};
|
||||
|
||||
|
@ -144,6 +144,9 @@ export class Modal extends React.Component<ModalProps, ModalState> {
|
||||
|
||||
handleEnter = () => {
|
||||
document.body.classList.add(`is-modalOpened`);
|
||||
if (document.body.scrollHeight > window.innerHeight) {
|
||||
document.body.classList.add(`has-scrollbar`);
|
||||
}
|
||||
};
|
||||
|
||||
handleEntered = () => {
|
||||
@ -155,8 +158,10 @@ export class Modal extends React.Component<ModalProps, ModalState> {
|
||||
const onExited = this.props.onExited;
|
||||
onExited && onExited();
|
||||
setTimeout(() => {
|
||||
document.querySelector('.amis-dialog-widget') ||
|
||||
if (!document.querySelector('.amis-dialog-widget')) {
|
||||
document.body.classList.remove(`is-modalOpened`);
|
||||
document.body.classList.remove(`has-scrollbar`);
|
||||
}
|
||||
}, 200);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user