From 4822a2867e39b8bfea46e0af75b2ae078c3159d9 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Thu, 13 May 2021 04:44:31 +0400 Subject: [PATCH] Fix breaking layout in desktop PWA mode Fix chat border-left --- src/components/chat/input.ts | 2 +- src/components/chat/selection.ts | 2 +- src/lib/appManagers/appImManager.ts | 6 +++++- src/scss/partials/_chat.scss | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/chat/input.ts b/src/components/chat/input.ts index f6bcaa2e..0d693ff6 100644 --- a/src/components/chat/input.ts +++ b/src/components/chat/input.ts @@ -101,7 +101,7 @@ export default class ChatInput { public sendSilent: true; private recorder: any; - private recording = false; + public recording = false; private recordCanceled = false; private recordTimeEl: HTMLElement; private recordRippleEl: HTMLElement; diff --git a/src/components/chat/selection.ts b/src/components/chat/selection.ts index 1e19c5d0..b856a861 100644 --- a/src/components/chat/selection.ts +++ b/src/components/chat/selection.ts @@ -289,7 +289,7 @@ export default class ChatSelection { } } */ - blurActiveElement(); // * for mobile keyboards + blurActiveElement(); let transform = '', borderRadius = ''; const forwards = !!this.selectedMids.size || forceSelection; diff --git a/src/lib/appManagers/appImManager.ts b/src/lib/appManagers/appImManager.ts index 0de4348a..e83644c2 100644 --- a/src/lib/appManagers/appImManager.ts +++ b/src/lib/appManagers/appImManager.ts @@ -486,7 +486,10 @@ export class AppImManager { e.target !== chat.input.messageInput && target.tagName !== 'INPUT' && !target.hasAttribute('contenteditable') && - !isTouchSupported) { + !isTouchSupported && + (!mediaSizes.isMobile || this.tabId === 1) && + !this.chat.selection.isSelecting && + !this.chat.input.recording) { chat.input.messageInput.focus(); placeCaretAtEnd(chat.input.messageInput); } @@ -689,6 +692,7 @@ export class AppImManager { } this.tabId = id; + blurActiveElement(); if(mediaSizes.isMobile && prevTabId === 2 && id < 2) { document.body.classList.remove(RIGHT_COLUMN_ACTIVE_CLASSNAME); } diff --git a/src/scss/partials/_chat.scss b/src/scss/partials/_chat.scss index 5c420ab1..dd82d6b9 100644 --- a/src/scss/partials/_chat.scss +++ b/src/scss/partials/_chat.scss @@ -484,7 +484,8 @@ $chat-helper-size: 39px; } body.is-left-column-shown & { - transform: translate3d(26.5rem, 0, 0); + //transform: translate3d(26.5rem, 0, 0); + transform: translate3d(26.5625rem, 0, 0); // + 1px to show left border .sidebar-close-button { transform: rotate(180deg);