Fix replacing input with new after peer changing
This commit is contained in:
parent
d1c9a25129
commit
e56c729880
@ -535,6 +535,7 @@ export default class ChatInput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private attachMessageInputField() {
|
private attachMessageInputField() {
|
||||||
|
const oldInput = this.messageInputField?.input;
|
||||||
this.messageInputField = new InputField({
|
this.messageInputField = new InputField({
|
||||||
placeholder: 'Message',
|
placeholder: 'Message',
|
||||||
name: 'message'
|
name: 'message'
|
||||||
@ -545,8 +546,8 @@ export default class ChatInput {
|
|||||||
this.attachMessageInputListeners();
|
this.attachMessageInputListeners();
|
||||||
|
|
||||||
const container = this.inputScroll.container;
|
const container = this.inputScroll.container;
|
||||||
if(container.firstElementChild) {
|
if(oldInput) {
|
||||||
container.replaceChild(this.messageInputField.input, container.firstElementChild);
|
oldInput.replaceWith(this.messageInputField.input);
|
||||||
} else {
|
} else {
|
||||||
container.append(this.messageInputField.input);
|
container.append(this.messageInputField.input);
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ export class AppStateManager extends EventListenerBase<{
|
|||||||
if(state) {
|
if(state) {
|
||||||
if(state.version != STATE_VERSION) {
|
if(state.version != STATE_VERSION) {
|
||||||
state = {};
|
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);
|
this.log('will refresh state', state.stateCreatedTime, time);
|
||||||
REFRESH_KEYS.forEach(key => {
|
REFRESH_KEYS.forEach(key => {
|
||||||
delete state[key];
|
delete state[key];
|
||||||
|
@ -61,7 +61,6 @@
|
|||||||
transition: .2s border-color;
|
transition: .2s border-color;
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
text-align: left;
|
|
||||||
//line-height: calc(54px - var(--border-width));
|
//line-height: calc(54px - var(--border-width));
|
||||||
/* overflow: hidden;
|
/* overflow: hidden;
|
||||||
white-space: nowrap; */
|
white-space: nowrap; */
|
||||||
|
@ -193,4 +193,8 @@
|
|||||||
margin-top: 100px;
|
margin-top: 100px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.input-field {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user