每当打开下载弹出窗口时,我的聊天框就会保持静止,但背景大小会随着消息的变化而动态变化。
因此,如果光标位于底部,则它会在下载弹出窗口打开后立即向高处移动
我试图制作position:fixed
,height:100%
或z-index +/-10
不幸的是,我不得不剪掉几行代码,这样我才能发布它。
HTML:
<div id="chatContent{{i}}" class="row chat-content">
</div>
<hr>
<div class="row mb-3 mt-2">
<div class="col-12 input-group">
<input id="userInput{{i}}" #userInput (keyup.enter)="sendMessage(userInput)"
class="form-control form-control-lg"
type="text" placeholder="Ask me something">
<div class="input-group-append">
<button mat-button
class="c-white bc-darkgreen bgc-darkgreen w-px-100 btn-left-no-round"
(click)="sendMessage(userInput);">
<i *ngIf="sendBlock;then loader else send"></i>
<ng-template #loader>
<fa class="fa fa-spin fa-2x" name="spinner"></fa>
<span class="sr-only">Sent!</span>
</ng-template>
<ng-template #send>
Send
</ng-template>
</button>
</div>
</div>
</div>
CSS:
.chat-block {
background-color: white !important;
border-radius: 5px;
}
.chat-content {
overflow-y: auto;
max-height: 75vh;
height: calc(75vh - 100px);
min-height: calc(75vh - 100px);
box-sizing: border-box;
order: -10;
}
.chat-margin {
margin-left: 5px;
margin-right: 15px;
}