diff --git a/src/components/dialogsContextMenu.ts b/src/components/dialogsContextMenu.ts index fffbe5446..4c8c633f8 100644 --- a/src/components/dialogsContextMenu.ts +++ b/src/components/dialogsContextMenu.ts @@ -121,7 +121,7 @@ export default class DialogsContextMenu { }, { langKey: 'FiltersSetupPinAlert', callback: () => { - appSidebarLeft.createTab(AppChatFoldersTab); + appSidebarLeft.createTab(AppChatFoldersTab).open(); } }], descriptionLangKey: 'PinToTopLimitReached2', diff --git a/src/components/stickerViewer.ts b/src/components/stickerViewer.ts index 16ae7fb1c..a4b182268 100644 --- a/src/components/stickerViewer.ts +++ b/src/components/stickerViewer.ts @@ -7,6 +7,7 @@ import IS_TOUCH_SUPPORTED from '../environment/touchSupport'; import cancelEvent from '../helpers/dom/cancelEvent'; import {simulateClickEvent, attachClickEvent} from '../helpers/dom/clickEvent'; +import findUpAsChild from '../helpers/dom/findUpAsChild'; import findUpClassName from '../helpers/dom/findUpClassName'; import getVisibleRect from '../helpers/dom/getVisibleRect'; import ListenerSetter from '../helpers/listenerSetter'; @@ -273,7 +274,8 @@ export default function attachStickerViewerListeners({listenTo, listenerSetter}: }; const onMousePreMove = (e: MouseEvent) => { - if(!findUpClassName(e.target, findClassName)) { + if(!findUpAsChild(e.target as HTMLElement, mediaContainer)) { + document.removeEventListener('mousemove', onMousePreMove); onMouseUp(); } }; @@ -293,7 +295,6 @@ export default function attachStickerViewerListeners({listenTo, listenerSetter}: attachClickEvent(document.body, cancelEvent, {capture: true, once: true}); } - document.removeEventListener('mousemove', onMousePreMove); document.removeEventListener('mousemove', onMouseMove); };