diff --git a/src/components/chat/contextMenu.ts b/src/components/chat/contextMenu.ts index 5936e075..1a9cd01d 100644 --- a/src/components/chat/contextMenu.ts +++ b/src/components/chat/contextMenu.ts @@ -117,9 +117,9 @@ export default class ChatContextMenu { if(chat.selection.isSelecting) return; // * these two lines will fix instant text selection on iOS Safari - attachTo.classList.add('no-select'); + document.body.classList.add('no-select'); // * need no-select on body because chat-input transforms in channels attachTo.addEventListener('touchend', () => { - attachTo.classList.remove('no-select'); + document.body.classList.remove('no-select'); }, {once: true}); cancelSelection(); diff --git a/src/components/chat/selection.ts b/src/components/chat/selection.ts index 8a45b58f..138c52a4 100644 --- a/src/components/chat/selection.ts +++ b/src/components/chat/selection.ts @@ -252,7 +252,16 @@ export default class ChatSelection { // ! CANCEL USER SELECTION ! cancelSelection(); } - } + }/* else { + if(!wasSelecting) { + bubblesContainer.classList.add('no-select'); + setTimeout(() => { + cancelSelection(); + bubblesContainer.classList.remove('no-select'); + cancelSelection(); + }, 100); + } + } */ blurActiveElement(); // * for mobile keyboards diff --git a/src/scss/partials/_chatBubble.scss b/src/scss/partials/_chatBubble.scss index bc8bd579..1e600587 100644 --- a/src/scss/partials/_chatBubble.scss +++ b/src/scss/partials/_chatBubble.scss @@ -238,9 +238,13 @@ $bubble-margin: .25rem; transition: .2s transform; user-select: none; - html.no-touch .bubbles:not(.is-selecting) &, + /* html.no-touch .bubbles:not(.is-selecting) &, html.is-touch .bubbles.is-selecting:not(.no-select) & { user-select: text; + } */ + html.no-touch .bubbles:not(.is-selecting) &, + html.is-touch body:not(.no-select) .bubbles.is-selecting & { // * need no-select on body because chat-input transforms in channels + user-select: text; } @include respond-to(not-handhelds) {