Skip to content

Commit 509c08e

Browse files
committed
update dialog-queue style about fixed overflow auto
1 parent 73b04e2 commit 509c08e

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/queue.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@ class DialogQueue extends React.Component {
1717
'hide': !isFirstDialog
1818
};
1919

20-
console.log(animateClass);
21-
2220
if(animateClass) {
2321
styleConfig[animateClass.enter] = !dialog.hide;
2422
styleConfig[animateClass.leave] = dialog.hide;
2523
}
2624

2725
const dialogStyle = classNames('dialog', styleConfig);
28-
console.log(dialogStyle)
2926
return React.createElement(dialog.cmpt, {
3027
key: dialog.name,
3128
$className: dialogStyle,
@@ -36,11 +33,14 @@ class DialogQueue extends React.Component {
3633
};
3734

3835
render() {
36+
const isShow = this.props.dialog.stack.length > 0;
3937
const queueStyle = classNames({
4038
'dialog-queue': true,
41-
'show': this.props.dialog.stack.length > 0
39+
'show': isShow
4240
});
4341

42+
document.body.style.overflow = isShow ? 'hidden' : '';
43+
4444
return (
4545
<div className={queueStyle}>
4646
{ this.generate(this.props.dialog.stack) }

src/queue.less

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.dialog-queue {
2-
position: absolute;
2+
position: fixed;
3+
overflow: auto;
34
top: 0;
45
right: 0;
56
bottom: 0;
@@ -24,4 +25,4 @@
2425
&.hide {
2526
display: none;
2627
}
27-
}
28+
}

0 commit comments

Comments
 (0)