Fix replacing input with new after peer changing

This commit is contained in:
Eduard Kuzmenko 2020-12-18 19:00:14 +02:00
parent d1c9a25129
commit e56c729880
4 changed files with 8 additions and 4 deletions

View File

@ -535,6 +535,7 @@ export default class ChatInput {
}
private attachMessageInputField() {
const oldInput = this.messageInputField?.input;
this.messageInputField = new InputField({
placeholder: 'Message',
name: 'message'
@ -545,8 +546,8 @@ export default class ChatInput {
this.attachMessageInputListeners();
const container = this.inputScroll.container;
if(container.firstElementChild) {
container.replaceChild(this.messageInputField.input, container.firstElementChild);
if(oldInput) {
oldInput.replaceWith(this.messageInputField.input);
} else {
container.append(this.messageInputField.input);
}

View File

@ -60,7 +60,7 @@ export class AppStateManager extends EventListenerBase<{
if(state) {
if(state.version != STATE_VERSION) {
state = {};
} else if(((state.stateCreatedTime || 0) + REFRESH_EVERY) < time && false) {
} else if(((state.stateCreatedTime || 0) + REFRESH_EVERY) < time/* && false */) {
this.log('will refresh state', state.stateCreatedTime, time);
REFRESH_KEYS.forEach(key => {
delete state[key];

View File

@ -61,7 +61,6 @@
transition: .2s border-color;
position: relative;
z-index: 1;
text-align: left;
//line-height: calc(54px - var(--border-width));
/* overflow: hidden;
white-space: nowrap; */

View File

@ -193,4 +193,8 @@
margin-top: 100px;
}
}
.input-field {
text-align: center;
}
}