diff --git a/src/components/middle/MessageList.scss b/src/components/middle/MessageList.scss index 4359801c0..d22cef628 100644 --- a/src/components/middle/MessageList.scss +++ b/src/components/middle/MessageList.scss @@ -300,30 +300,4 @@ transform: translate3d(0, calc(-1 * (var(--symbol-menu-height) + var(--symbol-menu-footer-height))), 0); } } - - &.select-mode-active, - &.has-focus-highlight, - body.has-context-menu &, - .animating > div > & { - /* - Remove scrollbar for full-width selection and compensate it with right padding - */ - &::-webkit-scrollbar { - width: 0; - } - - padding-right: 0; - - /* Styles for Firefox */ - @supports (scrollbar-width: none) { - padding-right: .6875rem; - scrollbar-width: none; - } - } - - .is-safari &.select-mode-active, - .is-safari &.has-focus-highlight, - .is-safari.has-context-menu .messages-layout & { - padding-right: .375rem; - } } diff --git a/src/components/middle/MessageList.tsx b/src/components/middle/MessageList.tsx index ffeca5f8d..4d5a28fc0 100644 --- a/src/components/middle/MessageList.tsx +++ b/src/components/middle/MessageList.tsx @@ -76,7 +76,6 @@ type StateProps = { isRestricted?: boolean; restrictionReason?: ApiRestrictionReason; focusingId?: number; - hasFocusHighlight?: boolean; isSelectModeActive?: boolean; animationLevel?: number; lastMessage?: ApiMessage; @@ -123,7 +122,6 @@ const MessageList: FC = ({ isRestricted, restrictionReason, focusingId, - hasFocusHighlight, isSelectModeActive, loadViewportMessages, setScrollOffset, @@ -455,7 +453,6 @@ const MessageList: FC = ({ noAvatars && 'no-avatars', !canPost && 'no-composer', type === 'pinned' && 'type-pinned', - hasFocusHighlight && 'has-focus-highlight', isSelectModeActive && 'select-mode-active', isScrolled && 'scrolled', !isReady && 'is-animating', @@ -547,7 +544,6 @@ export default memo(withGlobal( const { isRestricted, restrictionReason, lastMessage } = chat; const focusingId = selectFocusedMessageId(global, chatId); - const hasFocusHighlight = focusingId ? !global.focusedMessage!.noHighlight : undefined; const withLastMessageWhenPreloading = ( threadId === MAIN_THREAD_ID @@ -579,7 +575,6 @@ export default memo(withGlobal( isViewportNewest: type !== 'thread' || selectIsViewportNewest(global, chatId, threadId), threadFirstMessageId: selectFirstMessageId(global, chatId, threadId), focusingId, - hasFocusHighlight, isSelectModeActive: selectIsInSelectMode(global), botDescription, threadTopMessageId, diff --git a/src/hooks/useContextMenuHandlers.ts b/src/hooks/useContextMenuHandlers.ts index 191946b47..87d2678f2 100644 --- a/src/hooks/useContextMenuHandlers.ts +++ b/src/hooks/useContextMenuHandlers.ts @@ -5,9 +5,6 @@ import { IAnchorPosition } from '../types'; import { IS_TOUCH_ENV, IS_SINGLE_COLUMN_LAYOUT } from '../util/environment'; const LONG_TAP_DURATION_MS = 200; -const SELECTION_ANIMATION_DURATION_MS = 200; - -let contextMenuCounter = 0; function checkIsDisabledForMobile() { return IS_SINGLE_COLUMN_LAYOUT @@ -40,11 +37,6 @@ export default ( if (contextMenuPosition) { return; } - document.body.classList.remove('no-selection'); - if (contextMenuCounter === 0) { - document.body.classList.add('has-context-menu'); - } - contextMenuCounter++; setIsContextMenuOpen(true); setContextMenuPosition({ x: e.clientX, y: e.clientY }); @@ -57,13 +49,6 @@ export default ( const handleContextMenuHide = useCallback(() => { setContextMenuPosition(undefined); document.body.classList.remove('no-selection'); - - setTimeout(() => { - contextMenuCounter--; - if (contextMenuCounter === 0) { - document.body.classList.remove('has-context-menu'); - } - }, SELECTION_ANIMATION_DURATION_MS); }, []); // Support context menu on touch-devices diff --git a/src/modules/actions/ui/initial.ts b/src/modules/actions/ui/initial.ts index a8adc8496..672ebccec 100644 --- a/src/modules/actions/ui/initial.ts +++ b/src/modules/actions/ui/initial.ts @@ -2,7 +2,7 @@ import { addReducer, getGlobal, setGlobal } from '../../../lib/teact/teactn'; import { ANIMATION_LEVEL_MAX } from '../../../config'; import { - IS_ANDROID, IS_IOS, IS_MAC_OS, IS_SAFARI, IS_TOUCH_ENV, + IS_ANDROID, IS_IOS, IS_MAC_OS, IS_TOUCH_ENV, } from '../../../util/environment'; import { setLanguage } from '../../../util/langProvider'; import switchTheme from '../../../util/switchTheme'; @@ -31,9 +31,6 @@ addReducer('init', (global) => { switchTheme(theme, animationLevel === ANIMATION_LEVEL_MAX); startWebsync(); - if (IS_SAFARI) { - document.body.classList.add('is-safari'); - } if (IS_IOS) { document.body.classList.add('is-ios'); } else if (IS_ANDROID) {